Pagini recente » Cod sursa (job #2647331) | Cod sursa (job #840853) | Cod sursa (job #1225631) | Cod sursa (job #1637331) | Cod sursa (job #504015)
Cod sursa(job #504015)
#include<fstream>
#include<iostream>
#include<algorithm>
#define MDL 1999999973
#define ULL unsigned long long
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
ULL N,P,Nin;
void read();
ULL powr(ULL P);
int main()
{
read();
g<<powr(P);
f.close();
g.close();
return 0;
}
void read()
{
f>>N>>P;
N%=MDL;
Nin=N;
}
ULL powr(ULL P)
{
unsigned long long x;
if (P>1)
if (P%2==0)
{
x=powr(P/2);
return (x*x)%MDL;
}
else
{
x=powr(P-1);
return (N*x)%MDL;
}
return N;
}