Pagini recente » Cod sursa (job #635640) | Cod sursa (job #749975) | Cod sursa (job #804775) | Cod sursa (job #1124567) | Cod sursa (job #2365617)
#include <bits/stdc++.h>
#define modulo 1999999973
using namespace std;
ifstream fin ("lgput.in");
ofstream fout ("lgput.out");
int PutLog(int a, int n)
{
long long rez = 1;
while (n != 0)
{
if (n % 2 == 1)
rez = (1LL * rez * a) % modulo;
a = (1LL * a * a) % modulo;
n /= 2;
}
return rez;
}
int main()
{
int baza, putere;
fin >> baza >> putere;
int x = PutLog(baza, putere);
fout << x << "\n";
fin.close();
fout.close();
return 0;
}