Pagini recente » Cod sursa (job #875817) | Cod sursa (job #1621556) | Cod sursa (job #3121283) | Cod sursa (job #71887) | Cod sursa (job #1237146)
#include <fstream>
const int mod=1999999973;
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
int putere(int x, int y){
if (y==0) return 1;
else
if (y>0)
{
if (y%2==1) return (x%mod) * (putere(x%mod, (y-1)%mod));
else
return (putere(x%mod,(y/2)%mod))*putere(x%mod,(y/2)%mod);
}
}
int main()
{
int a,b;
f>>a>>b;
g<<putere(a,b)%mod;
return 0;
}