Pagini recente » Cod sursa (job #724093) | Cod sursa (job #207243) | Cod sursa (job #1682554) | Cod sursa (job #373001) | Cod sursa (job #1537977)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long lg_pow(long long a, long long b){
if(b == 0) return 1;
if(b == 1) return a % 1999999973;
long long aux = lg_pow(a, b / 2);
if(b % 2 == 0){
return (1LL*aux * aux) % 1999999973;
} else return (1LL*a * (1LL*aux * aux) % 1999999973) % 1999999973;
}
int main()
{
long long a, b;
fin >> a >> b;
fout << lg_pow(a, b);
return 0;
}