对任意正整数 N N N,计算 X N m o d 233333 X^N~mod~233333 XN mod 233333 的值。
输入格式
共一行,两个整数 X X X 和 N N N。
输出格式
共一行,一个整数,表示 X N m o d 233333 X^N~mod~233333 XN mod 233333 的值。
数据范围
1 ≤ X , N ≤ 1 0 9 1≤X,N≤10^9 1≤X,N≤109
输入样例:
2 5
输出样例:
32
#include<iostream>
using namespace std;
typedef long long LL;
const int mod = 233333;
int pow(int x, int n){
int res = 1;
while(n){
if(n & 1) res = ((LL)res * x) % mod;
x = ((LL)x * x) % mod;
n >>= 1;
}
return res;
}
int main(){
int x, n;
cin >> x >> n;
cout << pow(x, n) << endl;
return 0;
}