Pagini recente » Istoria paginii runda/baraj1_cnshb/clasament | Solutii Summer Challenge 2007, Runda 3 | Cod sursa (job #1522048) | Clasament concurs.olidej.9-10 | Cod sursa (job #1487847)
#include <fstream>
using namespace std;
ifstream in ("lgput.in");
ofstream out ("lgput.out");
int a, p, rez;
int putere (int a, int p)
{
int mod=1999999973;
if(p==0) return 1;
long long aux=putere(a, p/2);
if (p%2==0) return aux*aux%mod;
else return a*aux*aux%mod;
}
int main()
{
in>>a>>p;
rez=putere (a, p);
out<<rez;
return 0;
}