# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
213564 | berryzed | Great Pow! (kriii1_G) | Java | 121 ms | 13168 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import java.util.Scanner;
public class G {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long a = scanner.nextLong();
long k = scanner.nextLong();
System.out.println(pow(a, k) % 3);
}
private static long pow(long a, long k) {
if (k < 0) {
return a;
} else {
return pow(a * a, k-1);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |