Pagini recente » Cod sursa (job #60735) | Cod sursa (job #496) | Cod sursa (job #3299161) | Cod sursa (job #3291530) | Cod sursa (job #3299156)
#include<iostream>
#include<fstream>
#define MOD 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long fast_exponentiation(long long x, int n){
if(n == 0) return 1;
else if(n % 2 == 0) return (fast_exponentiation((x * x) % MOD, n / 2) % MOD);
else return (x * fast_exponentiation((x * x) % MOD, n / 2)) % MOD;
}
int main(){
long long n;
int p;
fin >> n >> p;
fout << fast_exponentiation(n, p);
fin.close();
fout.close();
return 0;
}