Submission #19425

# Submission time Handle Problem Language Result Execution time Memory
19425 2016-02-24T12:16:21 Z golala123 Α (kriii4_P1) C++
0 / 100
0 ms 1716 KB
#include <iostream>
#include <stdio.h>
using namespace std;
const int MOD = 1000000007;
long long a, x;
long long f(long long idx){
	if (idx == 1) return a;
	long long ret = 1;
	long long k = f(idx / 2) % MOD;
	if (idx % 2) ret *= (k*k*a) % MOD;
	else ret *= (k* k) % MOD;
	return ret %= MOD;
}
int main(){
	cin >> a >> x;
	a %= MOD;
	cout << f(x) % MOD;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1716 KB Output isn't correct
2 Halted 0 ms 0 KB -