Pagini recente » Cod sursa (job #1726795) | Cod sursa (job #430159) | Cod sursa (job #2766659) | Cod sursa (job #844323) | Cod sursa (job #1987265)
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
#define ll long long
#define pb push_back
const int NMax = 1e5 + 5;
const ll inf = 9e18 + 5;
const int mod = 1999999973;
ll A,B;
ll pw(ll,ll);
int main() {
in>>A>>B;
out<<pw(A,B);
in.close();out.close();
return 0;
}
ll pw(ll base,ll exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp & 1) {
return base * pw(base*base % mod,(exp-1)/2) % mod;
}
return pw(base*base % mod,exp/2) % mod;
}