Pagini recente » Cod sursa (job #2288980) | Cod sursa (job #2056372) | Cod sursa (job #1724145) | Cod sursa (job #2010388) | Cod sursa (job #1007569)
#include<fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int n_max = 10001;
const int m = 1999999973;
int main()
{
unsigned int i, Nr, Put;
long long aux, sol = 1;
fin>>Nr;fin>>Put;
aux = Nr;
for (i = 0; (1<<i) <= Put; ++ i)
{
if ( ((1<<i) & Put) > 0)
sol= (sol * aux) % m;
aux=(aux * aux) % m;
}
fout<<sol;
}