Pagini recente » Istoria paginii utilizator/rikka | Istoria paginii utilizator/larisa1995 | Diferente pentru planificare/sedinta-20091023 intre reviziile 31 si 30 | Statistici UBB InczeBakoBeiland UBB ABA (UBB_ABA) | Cod sursa (job #1761679)
#include <fstream>
using namespace std;
ifstream F ("lgput.in");
ofstream G ("lgput.out");
unsigned int power(int x, int P)
{
if (!P) return 1;
else if (P == 1) return x;
else if (P % 2 == 0) return power(x * x, P / 2);
else if (P % 2) return x * power(x * x, (P - 1) / 2);
}
unsigned int n, p;
int main()
{
F >> n >> p;
G << power(n, p) % 1999999973;
return 0;
}