Pagini recente » Cod sursa (job #2761364) | Rating Alexandra Dima (aldima) | Cod sursa (job #1844313) | Cod sursa (job #2082579) | Cod sursa (job #1649221)
#include <iostream>
#include <fstream>
#define mod 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long putere(long long x, long long y)
{
int r=1;
while(y)
{
if(y%2==1)
{
r=(r*x)%mod;
y--;
}
x=(x*x)%mod;
y=y/2;
}
return r;
}
int main()
{
int n, m;
fin>>n>>m;
fout<<putere(n, m);
fin.close();
fout.close();
return 0;
}