题目描述AC Code#include <iostream>using namespace std;typedef long long ll;ll a,b,m;ll solve(){ ll ans = 1,base = a; while(b > 0){ if(b&1){ ans *= base; ans %= m; } base *= base; base %= m; b >>= 1; } return ans%m;
题目描述AC Code#include <iostream>using namespace std;typedef long long ll;ll a,b,m;ll solve(){ ll ans = 1,base = a; while(b > 0){ if(b&1){ ans *= base; ans %= m; } base *= base; base %= m; b >>= 1; } return ans%m;