Pagini recente » Cod sursa (job #42051) | Cod sursa (job #2740813) | Cod sursa (job #1510801) | Cod sursa (job #2218665) | Cod sursa (job #1587452)
#include <iostream>
#include <fstream>
#define MOD 1999999973
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
long long int n,p;
long long int putere(long long int a,long long int b)
{
if(b==1)
return a%MOD;
else
{
if(b%2==1)
return (a*putere(a,b-1))%MOD;
else
{
long long int c = (putere(a,b/2))%MOD;
return (c*c)%MOD;
}
}
}
int main()
{
in>>n>>p;
in.close();
out<<putere(n,p);
out.close();
return 0;
}