常用的数论算法
# include <cstdio>
# include <cstring>
# include <algorithm>
# include <queue>
# include <map>
# define ll long long
using namespace std;
const int maxn = 1e6+10;
ll pri[maxn];
ll prime[maxn];
ll phi[maxn];
int tot = 0;
ll quick(ll a,ll b)
{
ll ans = 1;
while(b)
{
if(b&1){
ans *= a;
}
b >>= 1;
a *= a;
}
return ans;
}
void getPri()
{
tot = 0;
memset(pri,0,sizeof(pri));
pri[0] = pri[1] = 1;
for(ll i = 2;i < maxn;i++)
{
if(!pri[i]){
prime[tot++] = i;
for(ll j = i+i;j < maxn;j += i)
{
pri[j]++;
}
}
}
}
void getPhi()
{
for(ll i = 0;i < maxn;i++)
phi[i] = i;
for(ll i = 2;i < maxn;i++)
{
if(phi[i] == i)
{
for(ll j = i;j < maxn;j+=i)
{
phi[j] = phi[j] / i * (i-1);
}
}
}
}
ll euler(ll n)
{
ll ans = n;
for(ll i = 2;i*i <= n;i++)
{
if(n % i == 0) ans = ans / i * (i-1);
while(n % i == 0) n /= i;
}
if(n > 1) ans = ans / n * (n - 1);
return ans;
}
ll gcd(ll a,ll b)
{
return b == 0 ? a : gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
return a/gcd(a,b)*b;
}
int main()
{
ll a,b;
while(~scanf("%lld %lld",&a,&b))
{
printf("%lld\n",quick(a,b));
}
return 0;
}