Submission #3433

# Submission time Handle Problem Language Result Execution time Memory
3433 2013-08-31T05:46:48 Z ascamper Great Pow! (kriii1_G) C++
0 / 1
0 ms 1852 KB
#include <iostream>
#include <cmath>
using namespace std;

int gPow(int a, int k){
	double p = a;
	int result;
	for(int i = 0 ; i < k ; i++){
		p = pow(a, p);
	}

	return p;
}

int main(){

	int a, k;
	cin>>a;cin>>k;

	cout<<gPow(a,k)%(a+1)<<endl;

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