# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3770 | 2013-08-31T08:15:23 Z | pl0892029 | Great Pow! (kriii1_G) | C++ | 0 ms | 0 KB |
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main(void){ int a, k; scanf("%d %d", &a, &k); __int64 res = a; for(int i=0; i<k+1; i++){ res=pow((double)res, a); } printf("%d", res%(a+1)); }