Submission #213564

#TimeUsernameProblemLanguageResultExecution timeMemory
213564berryzedGreat Pow! (kriii1_G)Java
0 / 1
121 ms13168 KiB
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 timeMemoryGrader output
Fetching results...