# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19294 | cki86201 | Α (kriii4_P1) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <time.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pi;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
const ll MOD = 1e9 + 7;
ll pw(ll a,ll b){
a %= MOD;
ll res = 1;
while(b){
if(b&1)res = (res * a) % MOD;
a = (a * a) % MOD;
b >>= 1;
}
return res;
}
int main(){
ll a, b;
scanf("%lld%lld", &a, &b);
printf("%lld", pw(a, b));
return 0;
}