Pagini recente » Cod sursa (job #2396701) | Cod sursa (job #884610) | Cod sursa (job #2939277) | Cod sursa (job #2620371) | Cod sursa (job #1223293)
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const long long MOD = 1999999973;
long long a, b;
void Putere();
int main()
{
fin >> a >> b;
Putere();
fin.close();
fout.close();
return 0;
}
void Putere()
{
long long p = 1;
while ( b > 0 )
{
if ( b % 2 )
{
p *= a;
p %= MOD;
b--;
}
if ( !b ) break;
p = p * p;
p %= MOD;
b /= 2;
}
fout << p << '\n';
}