Pagini recente » Monitorul de evaluare | Cod sursa (job #579818) | Istoria paginii utilizator/sofeiandrei | Monitorul de evaluare | Cod sursa (job #2048248)
#include <fstream>
using namespace std;
ifstream F("lgput.in");
ofstream G("lgput.out");
int p;
long long ans = 1, n;
const int MOD = 1999999973;
int main()
{
F >> n >> p;
for( int i = 0; ( 1 << i ) <= p; ++ i )
{
if( ( ( 1 << i ) & p ) ) ans = 1LL * (n % MOD) * (ans % MOD);
ans %= MOD;
n = 1LL * (n % MOD) * (n % MOD);
}
G << ans;
return 0;
}