Pagini recente » Cod sursa (job #2206744) | Cod sursa (job #1416345) | Cod sursa (job #1895633) | Cod sursa (job #2206032) | Cod sursa (job #2344967)
#include <bits/stdc++.h>
using namespace std;
const int d = 1999999973;
ifstream fin("lgput.in");
ofstream fout("lgput.out");
float N, P;
int power(int x, int n){
if(x>d)
return (x%d, n);
if(n==0)
return 1;
else if(n==1)
return x;
else if(n%2==0)
return power(x*x, n/2); // 2*
else if(n%2==1)
return x*power(x*x, (n-1)/2);
}
int main(){
fin >> N >> P;
fout << power(N, P);
return 0;
}