Uva11609 teams
来源:互联网 发布:自己淘宝店铺的链接 编辑:程序博客网 时间:2024/05/23 22:16
主要是公式的推导和快速幂的使用,弹了一次,因为交大出的那本SCL快速幂的模板有点小错误
#include <iostream>#include <cmath>#include <cstdio>using namespace std;long long pow_mod(long long a,long long i,long long n){if(i == 0) return 1%n;long long tmp = pow_mod(a,i>>1,n);//书上tmp的类型为int tmp = tmp*tmp%n; if(i&1) tmp = (long long) tmp*a%n; return tmp;}int main(){int ncase,T=1;cin >> ncase;while(ncase--){long long l;scanf("%lld",&l);long long ans = (l*pow_mod(2,l-1,1000000007))%1000000007;cout<<"Case #"<<T++<<": "<<ans<<endl;}return 0;}
- Uva11609 teams
- UVa11609 Teams
- Teams(uva11609+组合)
- UVa11609 - Teams(快速求幂)
- UVA11609 - Teams(组合数学+快速幂)
- UVA11609
- UVa11609
- 组队 UVa11609
- Teams
- Dead Teams
- nba teams
- Choosing Teams
- Choosing Teams
- Ural 1106. Two Teams
- ural 1106. Two Teams
- 10911 - Forming Quiz Teams
- CF Forming Teams
- Outstanding Teams Award
- Java对象和XML转换
- when execute the ASM "LOCK" prefix, are all the memory being locked or are the relevant area in the
- 使用 SOCKET 通信实现 FTP 客户端程序
- 差分约束系统
- sql server 2008远程连接数据库的配置
- Uva11609 teams
- XCode工程中关于Targets的介绍
- CPU架构学习心得(一)
- ubuntu 安装redmine
- 字典树(非)
- 解决PKIX:unable to find valid certification path to requested target 的问题
- LeetCode-Plus One
- Hdu 1043 Eight
- 数据结构--线性表