Submission #4312

#TimeUsernameProblemLanguageResultExecution timeMemory
4312zorrapowerGreat Pow! (kriii1_G)C++98
0 / 1
0 ms1088 KiB
#include<stdio.h> int pow(int low, int exp); int main(void) { int a, k, exp; scanf("%d %d", &a, &k); exp=a; for(int i=1; i<=k; i++){ exp=pow(a, exp%(a+1)); } printf("%d", exp%(a+1)); return 0; } int pow(int low, int exp){ int result=1; for(int i=0; i<exp; i++) result*=low; return result; }
#Verdict Execution timeMemoryGrader output
Fetching results...