Rezultati

Up. imeNalogaJezikRezultatČas oddaje
bizgeci-2018 Droni Python 3 100/100OK 10. maj '18 @ 19:54

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 11,395 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#2 5/5 11,320 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#3 5/5 11,773 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#4 5/5 11,742 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#5 5/5 11,684 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#6 5/5 11,727 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#7 5/5 11,316 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#8 5/5 11,367 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#9 5/5 11,332 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#10 5/5 12,801 MiB 0,280 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#11 5/5 11,301 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#12 5/5 11,363 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#13 5/5 11,398 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#14 5/5 11,305 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#15 5/5 11,398 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#16 5/5 11,383 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#17 5/5 11,371 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#18 5/5 11,398 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#19 5/5 11,355 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#20 5/5 11,367 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.

Ocenjevani program (dron.py):
import random

x1,y1,z1,x2,y2,z2 = input().split(" ")

D1 = [int(x1),int(y1),int(z1)]
K1 = [int(x2),int(y2),int(z2)]


x1,y1,z1,x2,y2,z2 = input().split(" ")

D2 = [int(x1),int(y1),int(z1)]
K2 = [int(x2),int(y2),int(z2)]

D = [D1,D2]
K = [K1,K2]

premiki = [[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]

def ses(A,B):
    C = []
    for i in range(len(A)):
        C.append(A[i]+B[i])
    return C

def razdalja(D12, kate):
    return abs(D12[0] - K[kate][0])     +     abs(D12[1] - K[kate][1])     +     abs(D12[2] - K[kate][2])

def lahko(kate):
    dovoljeni = []
    for premik in premiki:
        if(ses(D[kate],premik) != D[1-kate]):
            dovoljeni.append(premik)
    return dovoljeni

def lahkoV(kate,S):
    dovoljeni = []
    for premik in S:
        if (ses(D[kate],premik) != D[1 - kate]):
            dovoljeni.append(premik)
    return dovoljeni


def zelimo(kate):
    zel = []
    for premik in premiki:
        if(razdalja(ses(D[kate],premik),kate) < razdalja(D[kate],kate)):
            zel.append(premik)
    return zel

def konec():
    return (D1 == K1 and D2 == K2)

def naKoncu(kate):
    return D[kate] == K[kate]

poti = []
vrstica = []
vrstica.append(D1)
vrstica.append(D2)
poti.append(vrstica)

while not konec():
    vrstica = []
    z = zelimo(0)
    z1 = lahkoV(0,z);
    n1 = len(z1)
    z2 = lahko(0)
    if naKoncu(0):
        pass
    elif n1>0:
        D1 = ses(D1,z1[random.randint(0,n1-1)])
    else:

        D1 = ses(D1,z2[random.randint(0,5-1)])
    a,b,c = D1
    vrstica.append(D1)
    D = [D1,D2]

    z = zelimo(1)
    z1 = lahkoV(1, z);
    n1 = len(z1)
    z2 = lahko(1)
    if naKoncu(1):
        pass
    elif n1 > 0:
        D2 = ses(D2,z1[random.randint(0, n1 - 1)])
    else:

        D2 = ses(D2,z2[random.randint(0, 5 - 1)])

    vrstica.append(D2)
    D = [D1, D2]
    poti.append(vrstica)

for v in poti:

    a, b, c = v[0]
    d, e, f = v[1]

    a = str(a)
    b = str(b)
    c = str(c)
    d = str(d)
    e = str(e)
    f = str(f)




    print("(" + a + " " + b + " " + c + ")" + " " + "(" + d + " " + e + " " + f + ")" )