HDU5363:Key Set
来源:互联网 发布:映速淘宝 编辑:程序博客网 时间:2024/06/17 19:23
A - A
Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64uDescription
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<cstdio>#define M 1000000007__int64 qpow(__int64 n){__int64 cnt=2,ans=1;while(n){if(n&1){ans=ans*cnt%M;}cnt=cnt*cnt%M;n>>=1;}return ans;}int main(){__int64 t;scanf("%I64d",&t);while(t--){__int64 n;scanf("%I64d",&n);//找规律 printf("%I64d\n",qpow(n-1)-1);}return 0;}
0 0
- HDU5363:Key Set
- 数论 - hdu5363 Key Set
- Key Set(HDU5363)
- HDU5363:Key Set
- Key Set(快速幂+数学分析) HDU5363
- [快速幂,取模]HDU5363 多校联合第六场 Key set
- key set
- key set
- Set Key 设置键
- HDU 5363 Key Set
- HDU 5363 Key Set
- hdu 5363 Key Set
- HDU 5363 Key Set
- 多校6-Key Set
- HDU 5363 Key Set
- HDU 5363 Key Set
- HDOJ-5363 Key Set
- HDOJ 5363 Key Set
- 7月比赛难题选解
- java-基础-集合hashset
- 【codefors】贪心
- 【技巧】简单理解快速幂(求模)
- 小结:c# setter属性注入
- HDU5363:Key Set
- dp,dip,sp,px,pt,mm,in区别与作用,getDimensionPixelSize,getDimension,getDimensionPixe区别
- HDU 2087 剪花布条 kmp
- MFC文档读取TXT文件中的数据并传输到对话框中
- jQuery插件记录 <一>基本的插件编写模式
- CSS伪类和伪元素的本质区别
- 发送短信验证码计时
- HDU 2066 一个人的旅行
- Servlet - Listener、Filter、Decorator