key set
来源:互联网 发布:dnf双开软件 编辑:程序博客网 时间:2024/05/22 02:02
soda has a set S S with n n integers {1,2,…,n} {1,2,…,n}. A set is called key set if the sum of integers in the set is an even number. He wants to know how many nonempty subsets of S S are key set.
The first line contains an integer
41234
0137
难点在于找到规律 2^n-1
#include<cstdio>const long long N=1e9+7;long long power(long long a){long long b=2;long long temp = 1;while (a){if (a&1){temp=temp*b%N;}b = b*b%N;a>>=1;}return temp;}int main(){int t;scanf("%d",&t);while (t--){long long n;scanf("%lld",&n);n-=1;printf("%lld\n",power(n)-1);}return 0;}
0 0
- key set
- key set
- Set Key 设置键
- HDU 5363 Key Set
- HDU 5363 Key Set
- HDU5363:Key Set
- hdu 5363 Key Set
- HDU 5363 Key Set
- 多校6-Key Set
- 数论 - hdu5363 Key Set
- HDU 5363 Key Set
- Key Set(HDU5363)
- HDU 5363 Key Set
- HDOJ-5363 Key Set
- HDOJ 5363 Key Set
- Key Set<hdoj5363>
- Key Set hd 5363
- HDOJ 5363 Key Set
- C#字符串的操作
- 不要62
- 解决ORA-04030报错
- the sum of cube 立方和
- PAT-1022-Digital Library
- key set
- ASP.Net数据库如何存取图片
- 爱摘苹果的小明
- leetcode 16. 3Sum Closest
- 使用Cocos Studio 创建帧动画
- [二进制分组 AC自动机] HDU 4787 GRE Words Revenge
- 用python做量化投资系列之比特币---布林带突破系统
- imresize 函数用法
- Pseudoprime numbers