Pagini recente » Cod sursa (job #913143) | Cod sursa (job #2818215) | Cod sursa (job #149665) | Cod sursa (job #552596) | Cod sursa (job #1925942)
#include <iostream>
#include <fstream>
#include <climits>
#include <algorithm>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
const int mod = 1999999973;
long long pw(long long,long long);
int main() {
long long B,E;
in>>B>>E;
out<<pw(B,E);
in.close();out.close();
return 0;
}
long long pw(long long b,long long e) {
if (e == 0) {
return 1;
}
if (e == 1) {
return b;
}
if (e % 2 == 1) {
return b * pw(b*b,(e-1)/2) % mod;
}
if (e % 2 == 0) {
return pw(b*b,e/2) % mod;
}
}