Pagini recente » Cod sursa (job #829774) | Cod sursa (job #2796327) | Cod sursa (job #494627) | Cod sursa (job #2040459) | Cod sursa (job #2076677)
#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;
x = x % mod;
if(n==1) return x;
if(n%2==0) return exponentiere(x * x % mod, n / 2 % mod) % mod;
if(n%2==1) return exponentiere(x * x % mod, (n - 1) / 2 % mod) % mod;
}
int main()
{
ll baza, exponent;
in >> baza >> exponent;
out << exponentiere(baza, exponent) % mod;
return 0;
}