Pagini recente » Cod sursa (job #515609) | Cod sursa (job #850644) | Cod sursa (job #841827) | Cod sursa (job #586797) | Cod sursa (job #1975499)
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
#define pb push_back
#define ll long long
const int NMax = 1e5 + 5;
const int mod = 1999999973;
ll N,K;
ll pw(ll,ll);
int main() {
in>>N>>K;
out<<pw(N,K)<<'\n';
in.close();out.close();
return 0;
}
ll pw(ll base,ll exp) {
if (!exp) {
return 1;
}
if (exp == 1) {
return base % mod;
}
if (exp & 1) {
return (base * pw((base * base) % mod,(exp-1)>>1) ) % mod;
}
return pw((base * base) % mod, (exp)>>1) % mod;
}