Teams(uva11609+组合)
I - Teams
Time Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
cid=77956#status//I/0" style="padding-bottom:0px; line-height:normal; margin:0px; padding-left:0px; padding-right:0px; font-family:Arial,Helvetica,sans-serif; color:rgb(73,73,73); font-size:14px; font-weight:normal; text-decoration:underline; padding-top:0px">Status
id=33600" target="_blank" style="padding-bottom:0px; line-height:normal; margin:0px; padding-left:0px; padding-right:0px; font-family:Arial,Helvetica,sans-serif; color:rgb(73,73,73); font-size:14px; font-weight:normal; text-decoration:underline; padding-top:0px">Practice
id=33600" target="_blank" style="padding-bottom:0px; line-height:normal; margin:0px; padding-left:0px; padding-right:0px; font-family:Arial,Helvetica,sans-serif; color:rgb(73,73,73); font-size:14px; font-weight:normal; text-decoration:underline; padding-top:0px">UVA
11609

题意:有n个人。选多个人參加比赛,当中一个是队长。队长不同其它选手同样也算作不同的方案。。问你一共同拥有多少种方案。
思路:自己才纸上略微推理一下,n*2n-1%mod;
转载请注明出处:
寻找&星空の孩子
题目链接:id=33600" target="_blank" style="padding-bottom:0px; line-height:normal; margin:0px; padding-left:0px; padding-right:0px; font-family:Arial,Helvetica,sans-serif; color:rgb(73,73,73); font-size:14px; font-weight:normal; text-decoration:underline; padding-top:0px">UVA
11609
11609
也欢迎来我开的专题刷题。哈哈cid=77956#overview" target="_blank" style="padding-bottom:0px; line-height:normal; margin:0px; padding-left:0px; padding-right:0px; font-family:Arial,Helvetica,sans-serif; color:rgb(73,73,73); font-size:14px; font-weight:normal; text-decoration:underline; padding-top:0px">http://acm.hust.edu.cn/vjudge/contest/view.action?
cid=77956#overview
#include<stdio.h>
#define mod 1000000007
#define LL long long
LL ppow(LL x,LL n)
{
LL tp=1;
while(n)
{
if(n&1) tp=tp*x%mod;
n>>=1;
x=x*x%mod;
}
return tp;
}
int main()
{
int ca=1,T;
scanf("%d",&T);
LL n;
while(ca<=T)
{
scanf("%lld",&n);
printf("Case #%d: %lld\n",ca++,(n*ppow(2,n-1))%mod);
}
return 0;
}
版权声明:本文博主原创文章,博客,未经同意不得转载。
Teams(uva11609+组合)的更多相关文章
- cf478B-Random Teams 【排列组合】
http://codeforces.com/problemset/problem/478/B B. Random Teams n participants of the competition w ...
- UVA 11609 - Teams 组合、快速幂取模
看题传送门 题目大意: 有n个人,选一个或者多个人参加比赛,其中一名当队长,如果参赛者相同,队长不同,也算一种方案.求一共有多少种方案. 思路: 排列组合问题. 先选队长有C(n , 1)种 然后从n ...
- 组合——Program B
CodeForces 478B Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u De ...
- cf478B Random Teams
B. Random Teams time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- codeforces 478B Random Teams
codeforces 478B Random Teams 解题报告 题目链接:cm.hust.edu.cn/vjudge/contest/view.action?cid=88890#probl ...
- Microsoft Teams 集成 (协作, 沟通 和 行为)
Microsoft Teams 集成 (协作, 沟通 和 行为) 概述 Microsoft Teams是在Office 365中以chat为中心的工作空间.软件开发团队可以快速获得在一个专门的团队协作 ...
- 复杂的 Hash 函数组合有意义吗?
很久以前看到一篇文章,讲某个大网站储存用户口令时,会经过十分复杂的处理.怎么个复杂记不得了,大概就是先 Hash,结果加上一些特殊字符再 Hash,结果再加上些字符.再倒序.再怎么怎么的.再 Hash ...
- JS继承之借用构造函数继承和组合继承
根据少一点套路,多一点真诚这个原则,继续学习. 借用构造函数继承 在解决原型中包含引用类型值所带来问题的过程中,开发人员开始使用一种叫做借用构造函数(constructor stealing)的技术( ...
- ComponentPattern (组合模式)
import java.util.LinkedList; /** * 组合模式 * * @author TMAC-J 主要用于树状结构,用于部分和整体区别无区别的场景 想象一下,假设有一批连锁的理发店 ...
随机推荐
- Cordova CLI源码分析(二)——package.json
每个包需要在其顶层目录下包含一个package.json文件,该文件不仅是包的说明,也影响npm安装包时的配置选项 更多参数详见参考文档https://npmjs.org/doc/json.html ...
- Wooden Sticks(杭州电1051)
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- Swing界面刷新问题(转)
在Java Swing编程中,往往会遇到需要动态刷新界面的时候,例如动态刷新JLabel的文本,JTextField里的文本等等.但是往往却没有达到我们预期的效果,我相信很多朋友都遇到过本文将要说的这 ...
- zoj Reactor Cooling
Reactor Cooling 无源汇上下界最大流问题. 1.流量平衡. 2.满足上下界 模板题. #include <iostream> #include <queue> # ...
- MySQL Full Join的实现
MySQL Full Join的实现 由于MySQL不支持FULL JOIN,以下是替代方法 left join + union(可去除反复数据)+ right join select * from ...
- Java并发学习之中的一个——线程的创建
本文是学习网络上的文章时的总结,感谢大家无私的分享. 1.与每一个Java语言中的元素一样,线程是对象.在Java中,我们有两种方式创建线程: a.通过直接继承thread类,然后覆盖run方法. b ...
- Android定位功能(二)
在前文Android定位功能(一)中,已经大致介绍了一下在Android平台中,和定位功能相关的类,并举例获取了位置信息.但是前文是基于Criteria定制了一个标准,通过getBestProvide ...
- vim代码折叠命令简短
作者:zhanhailiang 日期:2014-10-18 1. 通过fdm实现代码折叠:set fdm=xxx 有下面6种方式实现折叠: |fold-manual| manual Folds are ...
- Linux注意到Makefile
规则: 目标 : 依靠 命令 make是怎样工作的: (1)make在当前文件夹下寻找makefile或Makefile. (2)假设找到,他会寻找文件里的第一个目标文件(target).并把这个文件 ...
- mysql table is marked as crashed and last (automatic?) repair failed
1.同事的服务器在mysqldump备份的时候报错了 这个原因是myisam的表数据太多,在某个时刻, 存放数据的这个MyISAM表数据急速长大. 比如一些log表, 当硬盘写满了.这个时候还在继续写 ...