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 主要用于树状结构,用于部分和整体区别无区别的场景 想象一下,假设有一批连锁的理发店 ...
随机推荐
- Oracle自增列创建方法
最近在做Oracle的项目,由于以前没有接触过Oracle的开发,遇到了不少的问题,比如给Oracle表添加自增列,与SQL Server就不同. Oracle没有自增字段这样的功能,但是通过触发器( ...
- ecshop 全目录说明
ECShop 2.5.1 的结构图及各文件相应功能介绍 ECShop2.5.1_Beta upload 的目录 ┣ activity.php 活动列表 ...
- 每日算法之三十三:Trapping Rain Water
这是一个非常有意思的问题,求解最大容积问题,值得动脑筋想一想. 原题例如以下: Given n non-negative integers representing an elevation map ...
- 九度 题目1044:Pre-Post
转载请注明本文链接http://blog.csdn.net/yangnanhai93/article/details/40658571 题目链接:pid=1044">http://ac ...
- u-boot TFTP: 'Access violation' (2)
今天做tftp下载时间会遇到以下问题. --->8--- Load address: 0x20000000 Loading: * TFTP error: 'Access violation' ( ...
- centos在设置时区
[root@localhost ~]# date -R // 查看时区 Mon, 19 May 2014 10:18:46 +0000 [root@localhost ~]# tzselect ...
- hdu3530Subsequence rmq
//使用rmq办,ma[i][j],同i作为一个起点2^j阵列的最大长度值 //启动枚举问最长的子列 //枚举的最大长度2^(j-1)和2^(j)z之间 //然后在该范围内找到 #include< ...
- 15一个NoSql数据库
随着因特网web2.0该网站的兴起.非关系型数据库,现在已经成为一个非常受欢迎的新领域.非关系数据库产品的发展非常迅速.而在处理传统的关系数据库web2.0现场.特别是大规模,高并发SNS类型web2 ...
- effective c++ 条款9 do not call virtual function in constructor or deconstructor
在构造函数中不要调用virtual函数,调用了也不会有预期的效果. 举个例子 class Transaction { public: Transaction() { log(); } ; } clas ...
- SQL 修改排序规则的问题 sql_latin1_general_cp1_ci_as
在一个项目中遇到:用原来的数据库生成的脚本,然后部署到新的服务器上,数据库的SQL_Latin1_General_CP1_CI_AS 怎么查询出来汉字都是乱码了. 遂查解决方法. 需要执行这个 ALT ...