Pagini recente » Cod sursa (job #188249) | Rating Buha David-Cristian (BuhaDavid) | Cod sursa (job #2498919) | Cod sursa (job #732289) | Cod sursa (job #1648831)
#include <fstream>
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
const int MOD = 1999999973;
unsigned int n, p;
unsigned int power(unsigned int x, unsigned int p){
if(p == 0)
return 1;
else if(p == 1)
return x;
else{
unsigned int c = power(x, p/2);
return (c * c) % MOD;
}
}
int main()
{
f>>n>>p;
g<<power(n, p);
return 0;
}