Pagini recente » Cod sursa (job #327796) | Cod sursa (job #1137781) | Cod sursa (job #2503416) | Cod sursa (job #2873966) | Cod sursa (job #2930332)
#include <fstream>
using namespace std;
int main()
{
ifstream fin("lgput.in");
ofstream fout("lgput.out");
unsigned long long a, b, aux = 1, rez = 1, putere, aux3;
fin >> a >> b;
putere = a;
while (aux<=b)
{
aux3 = (b & aux);
if (aux3 != 0)
rez*=putere;
rez %= 1999999973;
aux <<= 1;
putere*= putere;
putere %= 1999999973;
}
fout << rez%1999999973;
return 0;
}