Pagini recente » Monitorul de evaluare | Diferente pentru problema/prod intre reviziile 10 si 11 | Cod sursa (job #3185859) | Cod sursa (job #2622875) | Cod sursa (job #967999)
Cod sursa(job #967999)
#include <iostream>
#include <fstream>
#define MOD 1999999973
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
int n,p;
int powmodulo ()
{
int b=1;
while (p)
{
if (p&1)
{
b=((b%MOD)*(n%MOD))%MOD;
p--;
}
n=((n%MOD)*(n%MOD))%MOD;
p=p>>1;
}
return b;
}
int main ()
{
f>>n>>p;
g<<powmodulo();
}