Pagini recente » Cod sursa (job #2986033) | Cod sursa (job #2291789) | Cod sursa (job #1348771) | Cod sursa (job #1396287) | Cod sursa (job #1587451)
#include <iostream>
#include <fstream>
#define MOD 1999999973
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int n,p;
int putere(int a,int b)
{
if(b==1)
return a%MOD;
else
{
if(b%2==1)
return (a*putere(a,b-1))%MOD;
else
{
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;
}