zoj3556 How Many Sets I-容斥
zoj3556 How Many Sets I-------容斥#includeiostream#includecstdlib#includestdio.husing namespa
zoj3556 How Many Sets I-------容斥
#include<iostream>#include<cstdlib>#include<stdio.h>using namespace std;#define mm 1000000007typedef long long ll;ll powermod(ll a,ll b){ ll res=1; while(b) { if(b&1)res=(res*a)%mm;//不能写成res*=a%mm~~~~~~~~~ a=a*a; a%=mm; b>>=1; } return res%mm;}int main(){ ll n,k; while(scanf("%lld%lld",&n,&k)!=EOF) { ll ans=powermod(2,k); ans--; ans=powermod(ans,n); printf("%lld\n",ans); }}