Pagini recente » Cod sursa (job #2051185) | Cod sursa (job #1944732) | Cod sursa (job #2278554) | Cod sursa (job #951057) | Cod sursa (job #2445201)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int MOD = 1999999973;
int lgPut(int base, int exp)
{
int ans = 1;
int aux = base;
for(int i = 1; 1LL * i <= exp; i <<= 1)
{
if(i & exp)
ans = (1LL * ans * aux) % MOD;
aux = (1LL * aux * aux) % MOD;
}
return ans % MOD;
}
int main()
{
int N, P; fin >> N >> P;
fout << lgPut(N, P);
return 0;
}