Pagini recente » Diferente pentru problema/dame2 intre reviziile 9 si 7 | Cod sursa (job #2571417) | Monitorul de evaluare | Monitorul de evaluare | Cod sursa (job #1814401)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
#define MOD 1999999973
int n,p;
int lgput(int n, int p)
{
if(p==0) return 1;
if(p&1) return 1LL*n*lgput(1LL*n*n%MOD,p>>1)%MOD;
return 1LL*lgput(1LL*n*n%MOD,p>>1)%MOD;
}
int main()
{
fin>>n>>p;
fout<<lgput(n,p);
return 0;
}