key set
来源:互联网 发布:软件著作权个人申请 编辑:程序博客网 时间:2024/05/22 06:14
Description
soda has a set with integers . 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 are key set.
Input
There are multiple test cases. The first line of input contains an integer , indicating the number of test cases. For each test case:
The first line contains an integer , the number of integers in the set.
The first line contains an integer
Output
For each test case, output the number of key sets modulo 1000000007.
Sample Input
41234
Sample Output
0137
#include<stdio.h>
__int64 quickpow(__int64 a,__int64 b,__int64 c){
__int64 tmp=a,res=1;
while(b)
{
if(b&1)
{
res*=tmp;
res%=c;
}
tmp*=tmp;
tmp%=c;
b>>=1;
}
return res;
}
int main()
{
__int64 n;
int t;
scanf("%d",&t);
while(t--)
{
scanf("%I64d",&n);
printf("%d\n",quickpow(2,n-1,1000000007)-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
- SpringMvc整合ehcaech
- NYOJ 91 阶乘之和(贪心)
- 重学 Statistics, Cha9 Hypothesis Tests
- js桥
- geekband_c++学习笔记1
- key set
- windows下Qt5.1 for android开发环境配置
- android:shape属性详解
- 贪心算法
- 【POJ3468】A Simple Problem with Integers-线段树和伸展树入门题
- MVVM介绍
- 内存管理:栈区,堆区,全局区,文字常量区,程序代码区
- Hust oj 1033 487-3279(map)
- 求最大公约数和最小公倍数