codeforces Alice and the list of presents

爱丽丝的礼物清单

#include
const int A=1e9+7;
using namespace std;
int pow(int x,int n)
{
	int result=1;
	while(n>0){
		if(n%2==1)
			result=(1ll*result*x)%A;
		x=(1ll*x*x)%A;//乘以 1(long long) 防止溢出 
		n=n/2;
	}
	return result;
}

int main()
{
	int n,m;
	cin>>n>>m;
	cout<<pow((pow(2,m)-1),n);
}  


你可能感兴趣的:(c,codeforces)