Pagini recente » Cod sursa (job #1689709) | Cod sursa (job #449778) | Cod sursa (job #1298937) | Cod sursa (job #2249820) | Cod sursa (job #3159227)
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
const string FILE_NAME = "lgput";
const string input = FILE_NAME + ".in";
const string output = FILE_NAME + ".out";
ifstream fin(input);
ofstream fout(output);
unsigned p(unsigned a, unsigned b, unsigned mod) {
long long rez = 1;
while (b>0) {
if (b % 2 == 1) {
rez = 1LL * rez * a % mod;
}
a = 1LL * a * a % mod;
b >>= 1;
}
while (rez < 0) rez += mod;
return rez;
}
int main()
{
unsigned a, b;
fin >> a >> b;
fout << p(a, b, 1999999973);
return 0;
}