Pagini recente » Cod sursa (job #2174475) | Cod sursa (job #2239079) | Cod sursa (job #1095988) | Cod sursa (job #2430017) | Cod sursa (job #2447460)
//
// main.cpp
// prlm
//
// Created by Andu Andu on 13/08/2019.
// Copyright © 2019 Andu Andu. All rights reserved.
//
#include <fstream>
#include <iostream>
using namespace std;
ifstream f ("lgput.in");
ofstream g ("lgput.out");
int i,n,k,w[100],v[100];
int a,b,p,q,mod;
long c = 1999999973;
int main() {
f>>a>>b;
n=b;
p=1;
q=a;
mod=c;
while(n)
{
if(n%2==1) p*=q;
q*=q;
n/=2;
p%=mod;
q%=mod;
}
g<<p;
return 0;
}