# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19366 | kdh9949 | Α (kriii4_P1) | C++98 | 0 ms | 1084 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 <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
ll a, b, t, ans = 1;
ll mod = 1000000007;
int main(){
scanf("%lld%lld", &a, &b);
t = a % mod;
for(ll i = 0; (1ll << i) <= b; i++){
if(b & (1 << i)) ans *= t, ans %= mod;
t *= t;
t %= mod;
}
printf("%lld", ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |