Pagini recente » Cod sursa (job #1606295) | Cod sursa (job #2347485) | Cod sursa (job #1283967) | Borderou de evaluare (job #2172714) | Cod sursa (job #2279824)
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream f ("lgput.in");
ofstream g ("lgput.out");
int k=1999999973;
long long int exp(long long int x,long long int y)
{
x%=k;
if(y==0)
{
return 1;
}
if(y%2)
{
return x*exp(x*x,(y-1)/2);
}
return exp( x*x,y/2);
}
int main()
{
long long int n,p;
f>>n>>p;
g<<exp(n,p);
}