Pagini recente » Cod sursa (job #2401870) | Cod sursa (job #3161454) | Cod sursa (job #1046741) | Cod sursa (job #2926921) | Cod sursa (job #656939)
Cod sursa(job #656939)
#include<fstream>
#define MOD 1999999973
using namespace std;
inline int pow(int x, int p){
int rez = 1; x %= MOD;
for(; p; p >>= 1) {
if(p & 1) {
rez *= x;
rez %= MOD;
}
x *= x;
x %= MOD;
}
return rez;
}
int main(void){
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n,p;
fin>>n>>p; fin.close();
fout<<pow(n,p); fout.close();
return 0;
}