Pagini recente » Autentificare | Cod sursa (job #2609146) | Diferente pentru multe-smenuri-de-programare-in-cc-si-nu-numai intre reviziile 2 si 3 | Diferente pentru problema/densitate intre reviziile 3 si 2 | Cod sursa (job #1512181)
#include<fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
const int k=1999999973;
long long exp(long long x,int n)
{
if(n==0)
return 1;
if(n==1)
return x;
if(n%2==0)
return exp(x*x%k, n/2);
if(n%2==1)
return x*exp(x*x%k,(n-1)/2)%k;
}
int main()
{
long long n,p;
f>>n>>p;
g<<exp(n,p)%k;
return 0;
}