Pagini recente » Cod sursa (job #1660664) | Cod sursa (job #1882918) | Cod sursa (job #1024425) | Diferente pentru preoni-2006/runda-1/solutii intre reviziile 24 si 26 | Cod sursa (job #2076680)
#include <iostream>
#include <fstream>
#define mod 1999999973
typedef long long ll;
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int exponentiere(ll x, ll n)
{
x = x % mod;
if(n==1) return x;
if(n%2==0) return exponentiere((x * x) % mod, n / 2 ) % mod;
return (x * exponentiere(x , n - 1 )) % mod;
}
int main()
{
ll baza, exponent;
in >> baza >> exponent;
out << exponentiere(baza, exponent);
return 0;
}