Pagini recente » Cod sursa (job #1982655) | Cod sursa (job #2406176) | Cod sursa (job #1124050) | Cod sursa (job #1105705) | Cod sursa (job #2200938)
#include <bits/stdc++.h>
using namespace std;
ifstream f ("lgput.in");
ofstream g ("lgput.out");
const int mod = 1999999973;
typedef long long ll;
ll lgPow(ll b, ll e) {
ll ans = 1;
ll aux = b;
for(int i = 1; i <= e; i *= 2) {
if(i & e) {
ans = (ans * aux) % mod;
}
aux *= aux;
aux %= mod;
}
return ans;
}
int main()
{
ll n, p;
f >> n >> p;
g << lgPow(n, p) << '\n';
f.close();
g.close();
return 0;
}