ZOJ 3556 How Many Sets I 容斥
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)); } }