Submission #3545

# Submission time Handle Problem Language Result Execution time Memory
3545 2013-08-31T06:30:54 Z eldkqmfhf123 Great Pow! (kriii1_G) C++
0 / 1
0 ms 1852 KB
#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

int main(void){

	int a, k, val, res=1;
	int i, j;

	cin >>a >>k;

	val = pow(a, a);

	for(i=0; i<k; i++)
		val = (int)pow(val, a) % (a+1);

	cout <<val <<endl;

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1852 KB Output is correct
2 Correct 0 ms 1852 KB Output is correct
3 Correct 0 ms 1852 KB Output is correct
4 Incorrect 0 ms 1852 KB Output isn't correct
5 Halted 0 ms 0 KB -