Pagini recente » Cod sursa (job #1791809) | Cod sursa (job #2819524) | Diferente pentru algoritmiada-2013 intre reviziile 3 si 17 | Cod sursa (job #1394143) | Cod sursa (job #1131162)
#include <fstream>
#define MOD 1999999973
using namespace std;
ifstream is("lgput.in");
ofstream os("lgput.out");
int x, n;
long long int Pow( int n, int x );
int main()
{
is >> n >> x;
os << Pow( n, x );
is.close();
os.close();
return 0;
}
long long int Pow( int n, int x )
{
if ( x == 0 ) return 1;
if ( x == 1 ) return n;
long long aux = Pow( n, x / 2 );
aux = ( aux * aux ) % MOD;
if ( x % 2 == 1 )
aux *= n;
return aux;
}