Key Set(快速幂)
来源:互联网 发布:淘宝客服的上班时间 编辑:程序博客网 时间:2024/05/16 19:09
Problem Description
soda has a set S with n integers {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 ofS are key set.
Input
There are multiple test cases. The first line of input contains an integerT (1≤T≤105) , indicating the number of test cases. For each test case:
The first line contains an integern (1≤n≤109) , 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
在1-n的子集中找到所有数相加为偶数的子集,当n=5时,为偶数的子集是15,n=6时,为偶数的子集总和为31,所以,我们发现子集总和为2^(n-1)-1.
0 0
- Key Set(快速幂)
- HDU 5363 Key Set (快速幂)
- 【HDU】-5363-Key Set(快速幂)
- hd 5363 Key Set(快速幂)
- (五):Key Set(快速幂+快速幂求模)
- Key Set(找规律+组合数学+快速幂)
- hdu 5363 Key Set 矩阵快速幂
- HDU 5363 Key Set(快速幂)
- HDOJ 5363 Key Set 【快速幂】
- Hdu 5363 Key Set【快速幂运算】
- 快速幂-HDOJ-5363-Key Set
- HDU 5363 Key Set(快速幂)
- HDU Problem - 5363 Key Set 【快速幂】
- HDU Problem 5363 Key set 【快速幂】
- Key Set(快速幂+数学分析) HDU5363
- Key Set 【hdu-5363】【快速幂】
- hdu 5363 Key Set (快速幂取模)
- HDUoj 5363 Key Set (快速幂,数学,规律
- Python学习(Leetcode 算法题解【21~40】)
- java中super关键字的理解(自己测试得出的结论)
- 【HDU】-2035-人见人爱A^B(快速幂)
- centos sonar Unable to start JVM: No such file or directory
- 【HDU】2824 - GCD(欧拉函数打表)
- Key Set(快速幂)
- Swift基础(十五)UIButton
- hdu 1598 find the most comfortable road(枚举+并查集)
- eclipse项目路径
- 16. 3Sum Closest
- ACM国内外OJ网站大集合
- Java 中的成员内部类
- javascript针对DOM的应用
- 【VS开发】 自己编写一个简单的ActiveX控件——详尽教程