【杭电】[5363]Key Set
来源:互联网 发布:nginx 泛解析 编辑:程序博客网 时间:2024/06/06 02:32
随便找下规律吧
答案是 2n-1-1
注意用快速幂时中间值溢出
#include<stdio.h>int MOD=1000000007;int pow(int a,int b) { __int64 r=1,t=a%MOD; while(b) { if(b&1) r=r*t%MOD; t=t*t%MOD; b>>=1; } return (int)r;}int main() { int T; scanf("%d",&T); while(T--) { int n; scanf("%d",&n); printf("%d\n",pow(2,n-1)-1); } return 0;}
题目地址:【杭电】[5363]Key Set
0 0
- 杭电-5363 Key Set
- 【杭电5363】Key Set
- 【杭电 5363】Key Set
- 【杭电】[5363]Key Set
- 杭电5363Key Set
- HDU 5363 Key Set
- HDU 5363 Key Set
- hdu 5363 Key Set
- HDU 5363 Key Set
- HDU 5363 Key Set
- HDU 5363 Key Set
- HDOJ-5363 Key Set
- HDOJ 5363 Key Set
- Key Set hd 5363
- HDOJ 5363 Key Set
- HDU - 5363 Key Set
- hdu 5363 Key Set
- HDOJ 5363 Key Set
- crontab 保持单进程执行
- Java单例设计模式(实现Java的一个类只有一个对象)
- 石子合并(区间型动规)
- 进程间通信方式总结
- 齐博建站指南
- 【杭电】[5363]Key Set
- iOS8 UICollectionView横向滑动demo
- 第一篇博文,不知道应该怎么开始,以测网速仪表盘开始
- warning: conflicting types for built-in function 'puts'
- JAVA实践最小生成树---kruskal算法
- 编程老手的哪些特点,是值得新手程序员学习的?
- RN输入法遮挡TextInput
- 【Android之实践】monkeyrunner采用对象id,进行UI自动化操作
- 构建yum的三种方式