Pagini recente » Cod sursa (job #1311266) | Cod sursa (job #209724) | Cod sursa (job #2819056) | Cod sursa (job #2054736) | Cod sursa (job #2436476)
//============================================================================
// Name : doing.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C, Ansi-style
//============================================================================
#include <iostream>
#include <fstream>
#define ll long long
#define M 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
ll pow(int b, int p)
{
ll prod = 1;
while(p > 0)
{
if(p & 1)
{
prod%=M;
prod*= b;
}
b%=M;
b*= b;
p/=2;
}
return prod;
}
int main()
{
int b, p;
fin >> b >> p;
fout << pow(b, p) % M;
}