Pagini recente » Cod sursa (job #1424080) | Cod sursa (job #1994404) | Cod sursa (job #605865) | Cod sursa (job #1006214) | Cod sursa (job #1516430)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
long long n,p;
int m = 1999999973;
void citire() {
f >> n >> p;
}
long long lgput(long long baza, long long exp) {
int rez = 1 , power = baza;
while(exp) {
if(exp & 1) {
rez = (1LL*rez*power)%m;
}
power = (1LL*power*power)%m;
exp >>=1;
}
return rez;
}
int main() {
citire();
g << lgput(n,p) << "\n";
}