Pagini recente » Cod sursa (job #1817921) | Monitorul de evaluare | Monitorul de evaluare | Diferente pentru problema/zuma intre reviziile 3 si 4 | Cod sursa (job #947410)
Cod sursa(job #947410)
#include <cstdlib>
#include <fstream>
using namespace std;
const int MODULO = 1999999973;
inline int pow(int x, int n)
{
int ans = 1;
for(; n; n >>= 1)
{
if(n&1)
{
ans = (1LL * ans * x) % MODULO;
}
x = (1LL * x * x) % MODULO;
}
return ans;
}
int main()
{
int x, n;
ifstream in("lgput.in");
ofstream out("lgput.out");
in >> x >> n;
out << pow(x, n) << '\n';
return EXIT_SUCCESS;
}