Rezultati

Up. imeNalogaJezikRezultatČas oddaje
ognjeniprocesor-2018 Droni Python 3 0/100Napačen odgovor (WA) 10. maj '18 @ 20:09

Test Točke Porabljen spomin Porabljen čas Status
#1 0/5 8,660 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#2 0/5 8,590 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#3 5/5 8,848 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#4 5/5 8,961 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#5 5/5 8,762 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#6 5/5 8,813 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#7 0/5 8,582 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#8 0/5 8,484 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#9 0/5 8,555 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#10 5/5 9,520 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#11 0/5 8,590 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#12 5/5 8,492 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#13 5/5 8,477 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#14 5/5 8,488 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#15 5/5 8,664 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#16 5/5 8,656 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#17 5/5 8,582 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#18 5/5 8,566 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#19 0/5 8,586 MiB 0,000 s Napačen odgovor
Povratna informacija sodniškega sistema:
​The program made an invalid move.
#20 5/5 8,594 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.

Ocenjevani program (droni.py):
def drone_sign(initial, final):
    if final>initial:
        return 1
    elif initial>final:
        return -1
    else:
        return 0


def get_drone_signs(current, final):
    dx = drone_sign(current[0], final[0])
    dy = drone_sign(current[1], final[1])
    dz = drone_sign(current[2], final[2])
    dv = [dx, dy, dz]
    return dv


def add_vector(x, dx, dim):
    new_x=list(x)
    new_x[dim]+=dx[dim]
    return new_x


def cycle(dim, current, final):
    while current[dim] == final[dim]:
        dim += 1
        dim %= 3
    return dim

dron1 = [int(num) for num in input().split()]
dron2 = [int(num) for num in input().split()]
dron1 = [ [i for i in dron1[:3]], [i for i in dron1[3:]] ]
dron2 = [ [i for i in dron2[:3]], [i for i in dron2[3:]] ]

dv1 = get_drone_signs(dron1[0], dron1[1])
dv2 = get_drone_signs(dron2[0], dron2[1])

current1 = dron1[0]
current2 = dron2[0]
final1 = dron1[1]
final2 = dron2[1]
dim1 = 0  # x
dim2 = 0  # x

koordinate1 = [current1]
koordinate2 = [current2]

while current1 != dron1[1] or current2 != dron2[1]:
    new1 = add_vector(current1, dv1, dim1)
    new2 = add_vector(current2, dv2, dim2)
    if new1 == new2 and current2 != new2 and current1 != new1:
        current1=new1
    elif new1 == current2 and new2 == current1:
        dim_prime = dim1 + 1
        dim_prime %= 3
        dv_prime = [1, 1, 1]

        new1 = add_vector(current1, dv_prime, dim_prime)
        koordinate1.append(new1)
        koordinate2.append(new2)

        new1 = add_vector(current1, dv1, dim1)
        koordinate1.append(new1)
        koordinate2.append(new2)

        new1 = add_vector(current1, dv1, dim1)
        koordinate1.append(new1)
        koordinate2.append(new2)

        dv_prime = [-1, -1, -1]
        new1 = add_vector(current1, dv_prime, dim_prime)
        current1 = new1
        current2 = new2
        dv1 = get_drone_signs(current1, final1)
        dv2 = get_drone_signs(current2, final2)

    elif new1 == new2:
        if current2 == final2:
            sum_of_dv=0
            for i in range(3):
                sum_of_dv+=abs(dv1[i])
            if sum_of_dv==1:
                dim_prime = dim1 + 1
                dim_prime %= 3
                dv_prime = [1, 1, 1]

                new1 = add_vector(current1, dv_prime, dim_prime)
                koordinate1.append(new1)
                koordinate2.append(new2)

                new1 = add_vector(current1, dv1, dim1)
                koordinate1.append(new1)
                koordinate2.append(new2)

                new1 = add_vector(current1, dv1, dim1)
                koordinate1.append(new1)
                koordinate2.append(new2)

                dv_prime = [-1, -1, -1]
                new1 = add_vector(current1, dv_prime, dim_prime)

                current1 = new1
                current2 = new2

                dv1 = get_drone_signs(current1, final1)
                dv2 = get_drone_signs(current2, final2)
            else:
                new_dim=cycle(dim1,current1,final1)
                new1 = add_vector(current1, dv1, new_dim)
                koordinate1.append(new1)
                koordinate2.append(new2)

                new1 = add_vector(current1, dv1, dim1)
                koordinate1.append(new1)
                koordinate2.append(new2)

                current1=new1
                current2=new2

                dv1 = get_drone_signs(current1, final1)
                dv2 = get_drone_signs(current2, final2)
        else:
            sum_of_dv = 0
            for i in range(3):
                sum_of_dv += abs(dv2[i])
            if sum_of_dv == 1:
                dim_prime = dim2 + 1
                dim_prime %= 3
                dv_prime = [1, 1, 1]

                new2 = add_vector(current2, dv_prime, dim_prime)
                koordinate1.append(new1)
                koordinate2.append(new2)

                new2 = add_vector(current2, dv2, dim2)
                koordinate1.append(new1)
                koordinate2.append(new2)

                new2 = add_vector(current2, dv2, dim2)
                koordinate1.append(new1)
                koordinate2.append(new2)

                dv_prime = [-1, -1, -1]
                new2 = add_vector(current2, dv_prime, dim_prime)

                current1 = new1
                current2 = new2

                dv1 = get_drone_signs(current1, final1)
                dv2 = get_drone_signs(current2, final2)
            else:
                new_dim = cycle(dim2, current2, final2)
                new2 = add_vector(current2, dv2, new_dim)
                koordinate1.append(new1)
                koordinate2.append(new2)

                new2 = add_vector(current2, dv2, dim2)
                koordinate1.append(new1)
                koordinate2.append(new2)

                current1 = new1
                current2 = new2

                dv1 = get_drone_signs(current1, final1)
                dv2 = get_drone_signs(current2, final2)



    else:
        current1 = new1
        current2 = new2
    if current1 == final1:
        dv1 = [0, 0, 0]
    elif current1[dim1] == final1[dim1]:
        dim1 = cycle(dim1, current1, final1)
    if current2 == final2:
        dv2 = [0, 0, 0]
    elif current2[dim2] == final2[dim2]:
        dim2 = cycle(dim2, current2, final2)
    koordinate1.append(current1)
    koordinate2.append(current2)

for i,x in enumerate(koordinate1):
    y = koordinate2[i]
    print("({} {} {}) ({} {} {})".format(*x, *y))