Pagini recente » Rating Sireanu Roland (sharky12592) | Cod sursa (job #3296022) | Rating Lilian Grindea (cuvacalapeco) | Cod sursa (job #813400) | 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;
}