Pagini recente » Cod sursa (job #2658288) | Cod sursa (job #454423) | Cod sursa (job #2511234) | Cod sursa (job #915435) | Cod sursa (job #1157111)
#include<fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long a, b, m;
long long putere(long long a, long long b){
long long rez;
if (b == 1)
return a % 1999999973;
if (b == 2)
return a * a % 1999999973;
if (b % 2 == 1)
return a * putere(a, b - 1) % 1999999973;
else {
rez = putere(a, b / 2) % 1999999973;
return rez * rez % 1999999973;
}
}
int main(){
fin >> a >> b;
fout << putere(a, b);
}