Pagini recente » Cod sursa (job #1700558) | Cod sursa (job #1332952) | Cod sursa (job #2600548) | Cod sursa (job #2801153) | Cod sursa (job #2422524)
#include <fstream>
#include <string>
using namespace std;
string const inFile = "lgput.in";
string const outFile = "lgput.out";
unsigned const MOD = 1999999973;
ifstream Read(inFile);
ofstream Write(outFile);
unsigned Power(unsigned base, unsigned exp) {
unsigned result = 1;
while (exp > 0) {
if (exp & 1) {
result = (long long)(result * base) % MOD;
}
exp >>= 1;
base = (long long)(base * base) % MOD;
}
return result;
}
int main() {
unsigned base;
unsigned exp;
Read >> base;
Read >> exp;
Write << Power(base, exp);
return 0;
}