Pagini recente » Cod sursa (job #42292) | Cod sursa (job #6444) | Cod sursa (job #513370) | Cod sursa (job #705412) | Cod sursa (job #2076668)
#include <iostream>
#include <fstream>
#define mod 1999999973
typedef long long ll;
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
ll exponentiere(ll x, ll n)
{
if(n==0) return 1;
else if(n==1) return x;
if(n%2==0) exponentiere(x * x, n / 2);
else if(n%2==1) exponentiere(x * x, (n - 1) / 2);
}
int main()
{
ll baza, exponent;
in >> baza >> exponent;
out << exponentiere(baza, exponent) % mod;
return 0;
}