Pagini recente » Cod sursa (job #631206) | Cod sursa (job #190005) | Cod sursa (job #3040055) | Cod sursa (job #996072) | Cod sursa (job #2244221)
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <array>
#include <algorithm>
#include <vector>
#include <stack>
#include <set>
#include <assert.h>
#include <queue>
using LL = long long;
using ULL = int long long;
const std::string _problemName = "lgput";
namespace std {
std::ifstream fin(_problemName + ".in");
std::ofstream fout(_problemName + ".out");
}
#define USE_FILES
#ifdef USE_FILES
#define cin fin
#define cout fout
#endif
LL fastPow(LL n, LL p, LL mod) {
LL current = n;
LL ans = 1;
for (int bit = 0; (1LL << bit) <= p; ++bit) {
if (p & (1LL << bit)) {
ans = (ans * current) % mod;
}
current = (current * current) % mod;
}
return ans;
}
int main() {
LL n, p;
std::cin >> n >> p;
std::cout << fastPow(n, p, 1999999973) << '\n';
return 0;
}