Key Set<hdoj5363>
来源:互联网 发布:金润软件成都 编辑:程序博客网 时间:2024/04/30 10:48
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 of S are key set.
Input
There are multiple test cases. The first line of input contains an integer T (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
#include<cstdio>long long quickpow(long long n){long long ans=1,base=2; n=n-1;while(n){if(n&1){ans=(base*ans)%1000000007;}base=(base*base)%1000000007;n>>=1;}return ans-1;}int main(){ int t; scanf("%d",&t); while(t--) { long long n; scanf("%lld",&n); printf("%lld\n",quickpow(n)); } return 0;}
0 0
- Key Set<hdoj5363>
- 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 hd 5363
- HDOJ 5363 Key Set
- 第三天 原串翻转
- 某公司泄露版IDA pro6.8去除局域网检测
- Stage4--Python面向对象
- HDU_多重背包系列
- POJ 2774 Long Long Message (后缀数组求最长公共子串)
- Key Set<hdoj5363>
- js中数组的用法
- 对如何入门Android的一些建议
- JSP技术(一)
- Brupsuite暴力破解DVWA渗透平台
- 快速幂模板<n的m次方对mod取余>
- RecyclerView子View宽度不充满父容器
- 编程语言IDE比较
- 什么是动态规划?动态规划的意义是什么?