bzoj 4475: [Jsoi2015]子集选取

233,扒题解的时候偷瞄到这个题的题解了,,GG

暴力发现是2^(nm),然后就是sb题了

 1 #include <bits/stdc++.h>
 2 #define LL long long
 3 using namespace std;
 4 const int mod=1e9+7;
 5 int ksm(int x, LL p)
 6 {
 7     int sum=1;
 8     for (;p;p>>=1,x=(LL)x*x%mod)
 9         if (p&1) sum=(LL)sum*x%mod;
10     return sum;
11 }
12 int n,m;
13 int main()
14 {
15     cin>>n>>m;
16     LL orz=(LL)n*m;
17     printf("%d
",ksm(2,orz));
18     return 0;
19 }
原文地址:https://www.cnblogs.com/ccd2333/p/6792633.html