Pagini recente » Diferente pentru problema/sezon intre reviziile 7 si 6 | Cod sursa (job #1804975) | Cod sursa (job #2482315) | Cod sursa (job #2739120) | Cod sursa (job #1166704)
#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 *= n;
rez %= MOD;
p--;
}
n *= n;
n %= MOD;
p /= 2;
}
fout << rez;
fin.close();
fout.close();
return 0;
}