Pagini recente » Cod sursa (job #1861301) | Cod sursa (job #2771667) | Cod sursa (job #247311) | Cod sursa (job #3176180) | Cod sursa (job #953942)
Cod sursa(job #953942)
#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;
}