Pagini recente » Cod sursa (job #2987555) | Cod sursa (job #1543116) | Cod sursa (job #3040551) | Cod sursa (job #1219918) | Cod sursa (job #2422526)
#include <fstream>
#include <string>
using namespace std;
#define LL long long
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 = (LL)((LL)(result) * (LL)(base)) % MOD;
}
exp >>= 1;
base = (LL)((LL)(base) * (LL)(base)) % MOD;
}
return result;
}
int main() {
unsigned base;
unsigned exp;
Read >> base;
Read >> exp;
Write << Power(base, exp);
return 0;
}