Files
java-competitive/dcj/tasks/query_of_death/query_of_death.java.1
2019-03-15 13:47:54 +04:00

22 lines
511 B
Groff

// Sample input 1, in Java.
public class query_of_death {
public query_of_death() {
}
static int isthenodebroken = 0;
static int testvs[] = {1, 1, 0};
public static long GetLength() {
return 3L;
}
public static long GetValue(long i) {
if (i < 0L || i >= GetLength())
throw new IllegalArgumentException("Invalid argument");
int val = (int)(testvs[(int)i]^((int)(Math.random() * 2 + 1) % (isthenodebroken + 1)));
if (i == 1)
isthenodebroken = 1;
return val;
}
}