# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
213565 |
2020-03-26T06:53:10 Z |
berryzed |
Great Pow! (kriii1_G) |
Java 11 |
|
104 ms |
11668 KB |
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) % (a + 1));
}
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 |
1 |
Incorrect |
104 ms |
11668 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |