Pagini recente » Cod sursa (job #404542) | Cod sursa (job #635347) | Cod sursa (job #2890804) | Borderou de evaluare (job #1600887) | Cod sursa (job #838837)
Cod sursa(job #838837)
#include<fstream>
#include<cstdio>
#define mod 1999999973
#define xxl long long
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
xxl x,y,sol=1;
int i;
void power(xxl a, xxl b)
{
for(i=0;(1<<i)<=y;++i)
{
if((( 1<<i) & y)>0)
sol=(sol*x)%mod;
x=(x*x)%mod;
}
}
int main()
{
f>>x>>y;
power(x,y);
g<<sol;
}