Rezultati

Up. imeNalogaJezikRezultatČas oddaje
jam-2018 Droni Java 100/100OK 10. maj '18 @ 19:12

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 39,527 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#2 5/5 37,000 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#3 5/5 61,520 MiB 0,738 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#4 5/5 53,629 MiB 0,221 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#5 5/5 53,984 MiB 0,558 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#6 5/5 56,094 MiB 0,401 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#7 5/5 36,227 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#8 5/5 36,688 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#9 5/5 37,066 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#10 5/5 64,582 MiB 0,629 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#11 5/5 39,398 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#12 5/5 34,266 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#13 5/5 36,664 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#14 5/5 37,277 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#15 5/5 35,328 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#16 5/5 38,680 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#17 5/5 35,445 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#18 5/5 39,469 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#19 5/5 38,242 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.
#20 5/5 34,418 MiB 0,000 s OK
Povratna informacija sodniškega sistema:
​The output was correct.

Ocenjevani program (Main.java):
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    static int ax, ay, az;
    static int bx, by, bz;

    static int tax, tay, taz;
    static int tbx, tby, tbz;
    
    static void print() {
        System.out.printf("(%d %d %d) (%d %d %d)%n", ax, ay, az, bx, by, bz);
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        ax = sc.nextInt();
        ay = sc.nextInt();
        az = sc.nextInt();
        tax = sc.nextInt();
        tay = sc.nextInt();
        taz = sc.nextInt();

        bx = sc.nextInt();
        by = sc.nextInt();
        bz = sc.nextInt();
        tbx = sc.nextInt();
        tby = sc.nextInt();
        tbz = sc.nextInt();

        print();
        if (az == bz) {
            az++;
            print();
        }

        while(ax != tax || ay != tay || bx != tbx || by != tby) {
            if(ax != tax) {
                ax += ax < tax ? 1 : -1;
            } else if(ay != tay) {
                ay += ay < tay ? 1 : -1;
            }

            if(bx != tbx) {
                bx += bx < tbx ? 1 : -1;
            } else if(by != tby) {
                by += by < tby ? 1 : -1;
            }
            print();
        }

        boolean specialCase = (ax == bx) && (ay == by);

        if (specialCase) {
            ax++;
            /*if (ax % 2 == 1) {
                ax++;
            }
            if (bx % 2 == 0) {
                bx++;
            }*/
            print();
        }

        while(az != taz || bz != tbz) {
            if(az != taz) {
                az += az < taz ? 1 : -1;
            }

            if(bz != tbz) {
                bz += bz < tbz ? 1 : -1;
            }
            print();
        }

        if(specialCase) {
            ax--;
            /*if (ax != tax) {
                ax += ax < tax ? 1 : -1;
            }

            if (bx != tbx) {
                bx += bx < tbx ? 1 : -1;
            }*/
            print();
        }

    }
}