Pagini recente » Cod sursa (job #1044708) | Cod sursa (job #3283689) | Cod sursa (job #1333304) | Cod sursa (job #1971547) | Cod sursa (job #436154)
Cod sursa(job #436154)
/*
* File: main.cpp
* Author: VirtualDemon
*
* Created on April 8, 2010, 8:23 AM
*/
#include <cstdlib>
#include <fstream>
#define Modulo 1999999973
/*
*
*/
using namespace std;
inline int pow( int x, int n ) // x^n
{
int r=1;
for( ; n; n>>=1 )
{
if( n&1 )
{
r=(1LL*r*x)%Modulo;
--n;
}
x=(1LL*x*x)%Modulo;
}
return r;
}
int main(int argc, char** argv)
{
int N, x;
ifstream in( "lgput.in" );
in>>x>>N;
ofstream out( "lgput.out" );
out<<pow( x, N )<<'\n';
return EXIT_SUCCESS;
}