【杭电5363】Key Set
2016-07-23 15:38
225 查看
#include<stdio.h> #define N 1000000007 __int64 quickpow(int a,int b) { __int64 ans=1,base=a; while(b) { if(b&1) { ans=ans*base%N; } base=base*base%N; b>>=1; } return ans; } int main() { int T; scanf("%d",&T); while(T--) { int n; scanf("%d",&n); __int64 t; t=quickpow(2,n-1)-1; printf("%I64d\n",t); } return 0; } [http://acm.hdu.edu.cn/showproblem.php?pid=5363](http://acm.hdu.edu.cn/showproblem.php?pid=5363)
相关文章推荐
- 高精度加法——杭电1002
- Hdu2066(一个人的旅行)
- 杭电1870 愚人节的礼物
- 关于杭电1405 The Last Practice 的问题
- hdu-1103 模拟题。
- hdu-1022 栈的应用。
- hdu-1247 简单map的应用。(字典树)
- hdu-1251 字典树公共前缀。
- hdu-1075 map映射表的应用。
- 杭电ACM Steps (1)
- hdu 1005 -- Number Sequence
- hdu 1007 -- Quoit Design
- 杭电1004
- 杭电1005
- 杭电1008
- c++编写藏手帕问题
- 杭电oj-1003
- 杭电oj-1004
- 杭电oj-1005
- 并查集示例1