Pagini recente » Cod sursa (job #1990192) | Cod sursa (job #239436) | Monitorul de evaluare | Cod sursa (job #523040) | Cod sursa (job #1295898)
#include <iostream>
#include <fstream>
#define mod 1999999973
using namespace std;
long long rp(long long x, long long y){
if(y==0) return 1;
if(y==1) return x;
if(y%2==0) return rp(x*x%mod,y/2)%mod;
return x*rp(x*x%mod,y/2)%mod;
}
int main()
{
long long a,b ;
ifstream f("lgput.in");
ofstream g("lgput.out");
f>>a >> b;
g<<rp(a,b);
f.close();
g.close();
return 0;
}