B. Alice and the List of Presents

mac2025-12-12  1

http://codeforces.com/contest/1236/problem/B 

#include <bits/stdc++.h> //#include <cmath> //#include <iostream> //#include <unordered_map> #define mem(x,y) memset(x,y,sizeof(x)) #define pb push_back #define INF 0x3f3f3f3f #define ll long long #define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; const int mod=1e9+7; const int N=2e5+9; ll ksm(ll x,ll n) { ll ans=1; while(n) { if(n&1) ans=ans*x%mod; x=x*x%mod; n>>=1; } return ans; } int main() { FAST_IO; int n,m; cin>>n>>m; cout<<ksm((ksm(2,m)-1+mod)%mod,n)<<endl; return 0; }

 

最新回复(0)