Pagini recente » Cod sursa (job #458936) | Cod sursa (job #2534705) | Cod sursa (job #2777005) | Cod sursa (job #3191295) | Cod sursa (job #1237144)
#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
while (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;
}