Pagini recente » Cod sursa (job #1337100) | Monitorul de evaluare | Cod sursa (job #2897629) | Cod sursa (job #1637337) | Cod sursa (job #1585721)
#include <fstream>
#define mod 1999999973
using namespace std;
ifstream f("lgput.in");
ofstream g("lgput.out");
unsigned long long a , b;
unsigned long long ridicare(int x, int n)
{
unsigned long long p = 1 ;
while (n > 0)
{
if (n & 1)
{
p = ((p * x ) % mod);
--n;
}
else
{
x = (x * x)%mod ;
n >>= 1 ;
}
}
return p ;
}
int main()
{
f >> a >> b;
g << ridicare(a , b);
return 0;
}