372. Super Pow

class Solution { //數學模冪運算公式 a * b % k = (a % k) * (b % k) % k; public: int base = 1337; int superPow(int a, vector<int>& b) { if(b.empty()) return 1; int back = b.back(); b.pop_back(); a = a % base; r
相關文章
相關標籤/搜索