Pagini recente » Cod sursa (job #1905834) | Cod sursa (job #2989051) | Cod sursa (job #2759869) | Cod sursa (job #2496484) | Cod sursa (job #2857588)
// Ridicare la putere in timp logaritmic.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <fstream>
#define MOD 1999999973
std::ifstream fin("lgput.in");
std::ofstream fout("lgput.out");
using namespace std;
typedef long long ll;
ll plog(ll b, ll e)
{
ll p = 1;
for (; e; e >>= 1, b = (b * b) % MOD)
if (e & 1)
p = (p * b) % MOD;
return p;
}
int main()
{
ll N, P;
fin >> N >> P;
fout << plog(N, P);
return 0;
}