Pagini recente » Cod sursa (job #2943305) | Cod sursa (job #1454481) | Cod sursa (job #1027260) | Cod sursa (job #1357118) | Cod sursa (job #3124036)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
long long a, b;
long long int ridicare(long long term, long long putere, int mod)
{
long long sol = 1;
term %= mod;
while (putere != 0)
{
if (putere % 2 == 1)
sol = term * sol % mod;
term = term * term % mod;
putere /= 2;
}
return sol;
}
int main()
{
fin >> a >> b;
fout << ridicare(a, b, 1999999973);
}