Pagini recente » Cod sursa (job #1933934) | Cod sursa (job #1581094) | Cod sursa (job #1032202) | Cod sursa (job #716391) | Cod sursa (job #2375780)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
int n, p;
const int MOD = 1999999973;
int pow_log(int, int);
int main(){
fin >> n >> p;
fout << pow_log(n, p);
}
int pow_log(int n, int p){
int r = 1;
while(p){
if(p % 2 == 1)
r = (1LL * r * n) % MOD;
n = (1LL * n * n) % MOD;
p /= 2;
}
return r;
}