Pagini recente » Borderou de evaluare (job #2077426) | Cod sursa (job #2797307) | Diferente pentru problema/sets intre reviziile 2 si 14 | Cod sursa (job #2011008) | Cod sursa (job #2535422)
#include <bits/stdc++.h>
using namespace std;
const int mod = 1999999973;
long long n, p;
long long lgpow(int n, int p) {
int sol = 1;
while (n) {
if (p & 1)
sol = n * p % mod;
p >>= 1;
n *= n;
}
return sol;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
cin >> n >> p;
cout << lgpow(n, p);
}