Pagini recente » Cod sursa (job #1993331) | Cod sursa (job #2290218) | Cod sursa (job #1830328) | Cod sursa (job #935488) | 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;
}