Pagini recente » Diferente pentru moisil-2015/bignumber intre reviziile 2 si 3 | Cod sursa (job #2351057) | Cod sursa (job #1794143) | Cod sursa (job #3303421) | Cod sursa (job #1450350)
#include <iostream>
#include <fstream>
using namespace std;
const int MOD = 1999999973;
ifstream f("lgput.in");
ofstream g("lgput.out");
int main()
{
long long n,p;
f>>n>>p;
if(p == 0){
g<<1;
return 0;
}
long long rez=1;
while(p){
if(p % 2 == 0){
n= n *n % MOD;
p/=2;
}else{
rez=rez *n % MOD;
p--;
}
}
g<< rez<<endl;
return 0;
}