ll quickPower(ll a, ll b, ll m) { ll ans = 1; ll base = a; while (b) { if (b & 1) ans *= base, ans %= m; base *= base; base %= m; b >>= 1; } return ans; } int main() { ll n, k; while (~scanf("%lld%lld", &n, &k)) { ll res = quickPower(2ll, k, MOD); printf("%lld\n", quickPower((res - 1 + MOD)%MOD, n, MOD)); } }
原文:https://www.cnblogs.com/hznumqf/p/13226652.html