Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,656 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#2 5/5 8,492 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#3 5/5 8,828 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#4 5/5 8,891 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#5 5/5 8,777 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#6 5/5 8,879 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#7 5/5 8,496 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#8 5/5 8,652 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#9 5/5 8,660 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#10 5/5 9,586 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#11 5/5 8,559 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#12 5/5 8,590 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#13 5/5 8,488 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#14 5/5 8,480 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#15 5/5 8,492 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#16 5/5 8,578 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#17 5/5 8,480 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#18 5/5 8,660 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#19 5/5 8,496 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#20 5/5 8,660 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.

Ocenjevani program (droni.py):
x1, y1, z1, x2, y2, z2 = map(int, input().split())
dron1 = (x1, y1, z1)
k1 = (x2, y2, z2)

x1, y1, z1, x2, y2, z2 = map(int, input().split())
dron2 = (x1, y1, z1)
k2 = (x2, y2, z2)

# x y, z
seznam1 = [(dron1, dron2)]

def premakni(dron, vektor):
    return (dron[0]+ vektor[0], dron[1] + vektor[1], dron[2] + vektor[2])
# x
smer1 = 1 if dron1[0] < k1[0] else -1
smer2 = 1 if dron2[0] < k2[0] else -1
while dron1[0] != k1[0] or dron2[0] != k2[0]:
    if dron1[0] != k1[0]:
        dron1 = premakni(dron1, (smer1, 0, 0))

        if dron1 == dron2:
            dron2 = premakni(dron2, (0, 1, 0))
            seznam1.append((dron1, dron2))

    if dron2[0] != k2[0]:
        dron2 = premakni(dron2, (smer2, 0, 0))

        if dron1 == dron2:
            dron2 = premakni(dron2, (-smer2, 1, 0))
            seznam1.append((dron1, dron2))

    seznam1.append((dron1, dron2))

# y
smer1 = 1 if dron1[1] < k1[1] else -1
smer2 = 1 if dron2[1] < k2[1] else -1
while dron1[1] != k1[1] or dron2[1] != k2[1]:
    if dron1[1] != k1[1]:
        dron1 = premakni(dron1, (0, smer1, 0))

        if dron1 == dron2:
            dron2 = premakni(dron2, (0, 0, 1))
            seznam1.append((dron1, dron2))

    if dron2[1] != k2[1]:
        dron2 = premakni(dron2, (0, smer2, 0))

        if dron1 == dron2:
            dron2 = premakni(dron2, (0, -smer2, 1))
            seznam1.append((dron1, dron2))

    seznam1.append((dron1, dron2))


# z
smer1 = 1 if dron1[2] < k1[2] else -1
smer2 = 1 if dron2[2] < k2[2] else -1
while dron1[2] != k1[2] or dron2[2] != k2[2]:
    if dron1[2] != k1[2]:
        dron1 = premakni(dron1, (0, 0, smer1))

        if dron1 == dron2:
            dron2 = premakni(dron2, (1, 0, 0))
            seznam1.append((dron1, dron2))

    if dron2[2] != k2[2]:
        dron2 = premakni(dron2, (0, 0, smer2))

        if dron1 == dron2:
            dron2 = premakni(dron2, (1, 0, -smer2))
            seznam1.append((dron1, dron2))

    seznam1.append((dron1, dron2))


# zdej smo prsl do enotske kocke blizu

if dron2 != k2:
    seznam1.append((dron1, k2))

for i in seznam1:
    print('({}) ({})'.format(' '.join(map(str, i[0])), ' '.join(map(str, i[1]))))