Pagini recente » Diferente pentru problema/asmin intre reviziile 1 si 9 | Cod sursa (job #1042185) | Diferente pentru problema/statiuni intre reviziile 4 si 3 | Cod sursa (job #1773538) | Cod sursa (job #1999805)
#include <iostream>
#include <fstream>
#define rest 1999999973
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
unsigned long long int n,p,x=1;
void putere()
{
while(p)
{
if(p%2==1)
{
x=(x*n)%rest;
p--;
}
else
{
n=(n*n)%rest;
p/=2;
}
}
}
int main()
{
f>>n>>p;
putere();
g<<x;
return 0;
}