Pagini recente » Cod sursa (job #1067035) | Cod sursa (job #2626231) | Cod sursa (job #968373) | Cod sursa (job #500537) | Cod sursa (job #1802513)
#include<fstream>
using namespace std;
typedef long long ll;
ifstream f("lgput.in");
ofstream t("lgput.out");
int n;
const int y = 1999999973;
long long p;
int ucif(int x, int n,int modul)
{
int tip;
if(n==0) return 1;
if(n%2==1) return (x*ucif(x,n-1,modul))%modul;
tip=ucif(x,n/2,modul)%modul;
return tip*tip%modul;
}
int main(){
f>>n>>p;
// int x;
// if(n==0) t<<"1";
// int cif = 1;
// while(n--)
// {
// cif = (cif*x)%y;
// }
// t<<cif;
t<<ucif(n,p,y);
return 0;
}