Pagini recente » Rating Vidrascu Ecaterina (VKaterina11) | Cod sursa (job #135774) | Cod sursa (job #2380158) | Cod sursa (job #2798080) | Cod sursa (job #1471586)
#include <iostream>
#include <fstream>
using namespace std;
int n,p;
long long expo(int baza, int exp)
{
if(exp==0)
return 1;
else
{
long long tmp=expo(baza,exp/2)%1999999973;
if(exp%2)
return (tmp*tmp*baza)%1999999973;
else
return (tmp*tmp)%1999999973;
}
}
int main()
{
ifstream f("lgput.in");
ofstream g("lgput.out");
f>>n>>p;
g<<expo(n,p)%1999999973;
f.close();
g.close();
return 0;
}