题解 | 礼物清单

礼物清单

https://www.nowcoder.com/practice/df443fe5b05f4d748922584265bfcf98

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int P=1e9+7;

int power(int a,int b,int p){
	int ans=1;
	while(b>0){
		if(b&1==1){
			ans=ans*a%p;
		}
		a=a*a%p;
		b=b>>1;
	}
	
	return ans;
}

int n,m;

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>n>>m;
	
	int res=power(power(2,m,P)-1,n,P);
	
	cout<<res<<endl;
    return 0;
}


全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务