Pagini recente » Cod sursa (job #3293941) | Cod sursa (job #55064) | Cod sursa (job #310115) | Cod sursa (job #2083171) | Cod sursa (job #2460870)
#include<iostream>
#include<fstream>
#define mod 1999999973
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int putere(int baza, int exp) {
int rez = 1;
while (exp > 0) {
if (exp % 2 == 1) {
rez = (1LL * rez*baza) % mod;
}
baza = (baza * baza)%mod;
exp /= 2;
}
return rez;
}
int main()
{
int n,p;
in >> n>>p;
out << putere(n, p);
system("pause");
}