Pagini recente » Partitie | Borderou de evaluare (job #2524661) | Cod sursa (job #2494501) | Borderou de evaluare (job #2256021) | Cod sursa (job #2520175)
#include <iostream>
#include <algorithm>
#include <fstream>
#define MOD 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long N, P;
int main()
{
long long cpy, ans = 1;
fin >> N >> P;
cpy = N;
for(int i = 0; (1 << i) <= P; i++){
if(((1 << i) & P) > 0){
ans = (ans * cpy) % MOD;
}
cpy = (cpy * cpy) % MOD;
}
fout << ans << "\n";
return 0;
}