Pagini recente » Cod sursa (job #3146219) | Cod sursa (job #1975335) | Cod sursa (job #975229) | Cod sursa (job #2403922) | Cod sursa (job #2998371)
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
int fast_pow(int base, int exponent, int mod) {
long long aux = 1;
while (exponent > 1) {
if (exponent % 2 == 1)
aux = 1ll * aux * base % mod;
base = 1ll * base * base % mod;
exponent /= 2;
}
return 1ll * base * aux % mod;
}
#define MOD 1999999973
int main() {
int n, p;
f >> n >> p;
g << fast_pow(n, p , MOD);
return 0;
}