Pagini recente » Cod sursa (job #2536048) | Cod sursa (job #1508755) | Diferente pentru problema/bacterii intre reviziile 7 si 8 | Cod sursa (job #2008845) | Cod sursa (job #2224803)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long b, e;
fin >> b >> e;
long long rez = 1LL, mod = 1999999973;
while(e){
if(e % 2 == 1){
rez *= b;
rez %= mod;
b *= b;
b %= mod;
e /= 2;
}
else{
b *= b;
b %= mod;
e /= 2;
}
}
fout << rez;
return 0;
}