Pagini recente » Cod sursa (job #1662846) | Cod sursa (job #52791) | Cod sursa (job #2844028) | Cod sursa (job #1741058) | Cod sursa (job #2469699)
#include <iostream>
#include <fstream>
#define NRSPEC 1999999973
#define ll long long
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll pt(ll nr,int exp){
ll rez=1;
for(int i=0;(1<<i)<=exp;i++){
if(((1<<i)&exp)>0)
rez=(rez*nr)%NRSPEC;
nr=(nr*nr)%NRSPEC;
}
return rez;
}
int main(){
int nr,exp;
//ll nr;
fin>>nr>>exp;
pt(nr,exp);
fout<<pt(nr,exp);
return 0;
}