您的位置:首页 > 其它

【杭电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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  杭电