1
class Solution {
2
public:
3
int binaryExp(int a, int b, int M) {
4
int ans = 1;
5
a %= M;
6
while (b) {
7
if (b & 1) ans = (ans * a) % M;
8
a = (a * a) % M, b = b >> 1;
9
}
10
return ans;
11
}
12

13
int superPow(int a, vector<int> &b) {
14
int bmod = 0;
15
for (auto it : b) {
16
bmod = (bmod * 10 + it) % 1140;
17
}
18

19
return binaryExp(a, bmod, 1337);
20
}
21
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0