Pagini recente » Diferente pentru problema/maraton intre reviziile 4 si 5 | Cod sursa (job #2068582) | Cod sursa (job #1138718) | Cod sursa (job #2729782) | Cod sursa (job #1166712)
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int MOD = 1999999973;
int n, p, rez;
int main() {
fin >> n >> p;
rez = 1;
while(p) {
if(p%2) {
rez = (rez * n) % MOD;
p--;
}
n = (n * n) % MOD;
p /= 2;
}
fout << rez;
fin.close();
fout.close();
return 0;
}