Pagini recente » Cod sursa (job #3221337) | Cod sursa (job #184411) | Cod sursa (job #1685659) | Cod sursa (job #186005) | Cod sursa (job #2465935)
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const int n_max = 10001;
const int m = 1999999973;
int n, p;
long long sol=1;
int main(){
fin >> n >> p;
long long a = n;
for (int i = 0; (1<<i) <= p; ++ i){
if ( ((1<<i) & p) > 0)
sol= (sol * a) % m;
a=(a * a) % m;
}
fout << sol;
}