Pagini recente » Borderou de evaluare (job #2116720) | Cod sursa (job #282869) | Cod sursa (job #793072) | Cod sursa (job #42070) | Cod sursa (job #1349445)
#include <iostream>
#include <fstream>
using namespace std;
const int mod = 1999999973;
int n, p;
inline int lgpow(int a, int b) {
a %= mod;
int ans = 1;
for( ; b ; b >>= 1) {
if(b & 1)
ans = (1LL * ans * a) % mod;
a = (1LL * a * a) % mod;
}
return ans;
}
int main() {
ifstream fin("lgput.in");
ofstream fout("lgput.out");
fin >> n >> p;
fout << lgpow(n, p) << '\n';
}