Pagini recente » Cod sursa (job #378577) | Cod sursa (job #2676020) | Borderou de evaluare (job #2072007) | Cod sursa (job #2328576) | Cod sursa (job #1604220)
#include <fstream>
using namespace std;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
const long int m = 1999999973;
long int get_pow(int n, int k)
{
long long aux;
if(k == 0)
return 1;
if( k % 2 == 0)
{
aux = get_pow(n, k/2)%m;
aux = (aux *aux)%m;
return aux;
}
else
{
aux = get_pow(n,k-1)%m;
aux *= n%m;
return aux;
}
}
int main()
{
int n, k;
fin >> n >> k ;
fout << get_pow(n, k);
return 0;
}