Pagini recente » Cod sursa (job #1351523) | Cod sursa (job #1941670) | Cod sursa (job #2795723) | Cod sursa (job #511884) | Cod sursa (job #447349)
Cod sursa(job #447349)
/*
* File: main.cpp
* Author: virtualdemon
*
* Created on April 28, 2010, 3:02 PM
*/
#include <cstdlib>
#include <fstream>
#define Modulo 1999999973
/*
*
*/
using namespace std;
inline int pow( int x, int n )
{
int r=1;
for( ; n; n>>=1 )
{
if( n&1 )
{
r=(1LL*x*r)%Modulo;
--n;
}
x=(1LL*x*x)%Modulo;
}
return r;
}
int main(int argc, char** argv)
{
int x, N;
ifstream in( "lgput.in" );
in>>x>>N;
ofstream out( "lgput.out" );
out<<pow( x, N )<<'\n';
return (EXIT_SUCCESS);
}