Pagini recente » Diferente pentru problema/rucsac intre reviziile 15 si 21 | Cod sursa (job #1322551) | Cod sursa (job #1881596) | Cod sursa (job #955465) | Cod sursa (job #947410)
Cod sursa(job #947410)
#include <cstdlib>
#include <fstream>
using namespace std;
const int MODULO = 1999999973;
inline int pow(int x, int n)
{
int ans = 1;
for(; n; n >>= 1)
{
if(n&1)
{
ans = (1LL * ans * x) % MODULO;
}
x = (1LL * x * x) % MODULO;
}
return ans;
}
int main()
{
int x, n;
ifstream in("lgput.in");
ofstream out("lgput.out");
in >> x >> n;
out << pow(x, n) << '\n';
return EXIT_SUCCESS;
}