Pagini recente » Cod sursa (job #492629) | Cod sursa (job #382788) | Cod sursa (job #1896405) | Cod sursa (job #46919) | Cod sursa (job #2469696)
#include <iostream>
#include <fstream>
#define NRSPEC 1999999973
#define ll long long
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll pt(int 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;
fin>>nr>>exp;
fout<<pt(nr,exp);
return 0;
}