Pagini recente » Cod sursa (job #2380775) | Cod sursa (job #988468) | Cod sursa (job #2847099) | Cod sursa (job #2749935) | Cod sursa (job #2763374)
#include <iostream>
#include <fstream>
#define Mod 1999999973
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
void LOG(int baza, int exp)
{
long long res = 1;
if(exp == 0)
fout << 1;
if(exp == 1)
fout << baza;
while(exp)
{
if(exp % 2 == 1)
res = (res * baza) % Mod;
baza = baza * baza;
exp = exp / 2;
}
fout << (res * baza) % Mod;
}
int main()
{
int baza, exp;
fin >> baza >> exp;
LOG(baza, exp);
return 0;
}