Pagini recente » Cod sursa (job #2725985) | Cod sursa (job #2843290) | Cod sursa (job #3259445) | Cod sursa (job #488601) | Cod sursa (job #736524)
Cod sursa(job #736524)
#include <fstream>
#include <cstdlib>
using namespace std;
const int MODULO=1999999973;
inline int pow(int x, int n)
{
int r;
for(r=1; n; n>>=1)
{
if(n&1)
r=(1LL*r*x)%MODULO;
x=(1LL*x*x)%MODULO;
}
return r;
}
int main()
{
int x, n;
ifstream in("lgput.in");
ofstream out("lgput.out");
in>>x>>n;
out<<pow(x, n)<<'\n';
return EXIT_SUCCESS;
}