Pagini recente » Cod sursa (job #2731490) | Cod sursa (job #1373985) | Cod sursa (job #708964) | Cod sursa (job #2236797) | Cod sursa (job #2173979)
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
const long MOD=1999999973;
typedef unsigned long long ull;
ull N,P;
ull lgput(ull a, ull b)
{
if(b==0) return 1;
if(b==1) return a;
ull aux=lgput(a, b/2);
if(b&1) return ((((aux*aux)%MOD)*a)%MOD);
return (aux*aux)%MOD;
}
int main()
{
f>>N>>P;
g<<lgput(N,P);
return 0;
}