Pagini recente » Cod sursa (job #1218146) | Cod sursa (job #2847882) | Cod sursa (job #2857058) | Cod sursa (job #949882) | Cod sursa (job #2238886)
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
typedef long long LL;
const LL MOD = 1999999973;
LL expo(LL baza ,LL exponent)
{
if(exponent == 0)
return 1;
LL radical = expo(baza ,exponent / 2);
LL putere = radical * radical % MOD;
if(exponent % 2 == 1)
putere = putere * baza % MOD;
return putere;
}
LL N,P;
int main()
{
f>>N>>P;
g<<expo(N,P);
return 0;
}