【BZOJ4475】子集选取(计数)

题意:

思路:

 1 #include<cstdio>
 2 #include<cstdlib>
 3 #include<iostream>
 4 #include<algorithm>
 5 #include<cstring>
 6 #define MOD 1000000007
 7 typedef long long LL;
 8 using namespace std;
 9 LL n,k,ans;
10 
11 LL pow(LL x,LL y)
12 {
13     LL s=1; LL t=x;
14     while(y)
15     {
16         if(y&1) s=s*t%MOD;
17         t=t*t%MOD;
18         y>>=1;
19     }
20     return s;
21 }
22   
23 
24 int main()
25 {
26     freopen("bzoj4475.in","r",stdin);
27     freopen("bzoj4475.out","w",stdout);
28     scanf("%lld%lld",&n,&k);
29     ans=pow(2,n*k);
30     printf("%lld\n",ans);
31     return 0;
32 }
33 
34 
35  
36  

 

posted on 2018-07-21 19:46  myx12345  阅读(281)  评论(0编辑  收藏  举报

导航