I - Teams

Time Limit:1000MS     Memory Limit:0KB     64bit IO Format:%lld
& %llu

Submit 

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

也欢迎来我开的专题刷题。哈哈

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+组合)的更多相关文章

  1. cf478B-Random Teams 【排列组合】

    http://codeforces.com/problemset/problem/478/B B. Random Teams   n participants of the competition w ...

  2. UVA 11609 - Teams 组合、快速幂取模

    看题传送门 题目大意: 有n个人,选一个或者多个人参加比赛,其中一名当队长,如果参赛者相同,队长不同,也算一种方案.求一共有多少种方案. 思路: 排列组合问题. 先选队长有C(n , 1)种 然后从n ...

  3. 组合——Program B

    CodeForces 478B Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u De ...

  4. cf478B Random Teams

    B. Random Teams time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  5. codeforces 478B Random Teams

    codeforces   478B  Random Teams  解题报告 题目链接:cm.hust.edu.cn/vjudge/contest/view.action?cid=88890#probl ...

  6. Microsoft Teams 集成 (协作, 沟通 和 行为)

    Microsoft Teams 集成 (协作, 沟通 和 行为) 概述 Microsoft Teams是在Office 365中以chat为中心的工作空间.软件开发团队可以快速获得在一个专门的团队协作 ...

  7. 复杂的 Hash 函数组合有意义吗?

    很久以前看到一篇文章,讲某个大网站储存用户口令时,会经过十分复杂的处理.怎么个复杂记不得了,大概就是先 Hash,结果加上一些特殊字符再 Hash,结果再加上些字符.再倒序.再怎么怎么的.再 Hash ...

  8. JS继承之借用构造函数继承和组合继承

    根据少一点套路,多一点真诚这个原则,继续学习. 借用构造函数继承 在解决原型中包含引用类型值所带来问题的过程中,开发人员开始使用一种叫做借用构造函数(constructor stealing)的技术( ...

  9. ComponentPattern (组合模式)

    import java.util.LinkedList; /** * 组合模式 * * @author TMAC-J 主要用于树状结构,用于部分和整体区别无区别的场景 想象一下,假设有一批连锁的理发店 ...

随机推荐

  1. Java-UrlRewrite中文api文档

    安装 1. 下载jar包, 并加入到WEB-INF/lib下 2. 在WEB-INF/web.xml中增加下面的配置 <filter> <filter-name>UrlRewr ...

  2. 集成框架 javaweb开发平台ssmy_m(生成代码) java struts2 mybatis spring maven jquery

    网页地址 http://blog.csdn.net/lpy3654321/article/details/31841573 项目设想,在项目开发中,我们的开发者大多数时间都在反复开发 相同的keywo ...

  3. Ubuntu Linux 永山(mount)分

    在一般情况下,我们想安装一个分区解决方案是使用mount命令,因为我想/dev/sda3安装/media/aborn/data通过使用下面的命令 sudo mount /dev/sda3 /media ...

  4. ZOJ 2334(Monkey King-左偏树第一题)

    Monkey King Time Limit: 10 Seconds      Memory Limit: 32768 KB Once in a forest, there lived N aggre ...

  5. 【leetcode】LRU

    import java.util.HashMap; import java.util.Map; public class LRUCache { private int capacity; privat ...

  6. 获取listboxitem在ListBox中的index并转换成abcd

    原文 获取listboxitem在ListBox中的index并转换成abcd 截图如下: 1.实现Converter  获取到listbox,并得到listitem在listbox中的index p ...

  7. android-adb通用

  8. 【转】QT样式表 (QStyleSheet)

    作者:刘旭晖 Raymond 转载请注明出处Email:colorant@163.comBLOG:http://blog.csdn.net/colorant/ 除了子类化Style类,使用QT样式表( ...

  9. 转载:Raspberry Pi 树莓派入门

    转载说明: 整理转载,原文链接http://www.eeboard.com/bbs/thread-5191-1-1.html 这篇帖子我打算用Q&A的方式来编写,这样大家更容易一目了然的看明整 ...

  10. 搬寝室 hdu

    Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆, ...