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. 一个极其简洁的Python网页抓取程序,自己主动从雅虎財经抓取股票数据

    本程序使用Python 2.7.6编写,扩展了Python自带的HTMLParser,自己主动依据预设的股票代码列表,从Yahoo Finance抓取列表中的数据日期.股票名称.实时报价.当日变化率. ...

  2. html中滚动栏的样式

    DIV滚动栏设置 (CSS)2008/09/26 03:07div 中滚动栏的控制2008年01月06日 星期日 01:181)隐藏滚动栏<body style="overflow-x ...

  3. 关于git的ssh-key:解决本地多个ssh-key的问题

    在设置github的时候,官方的说明文档要求备份当前的id_rsa.然后生成一份新的私钥用于github的登陆.假设真这样做,那么新的私钥是无法再继续登陆之前的机器的. 这样的方法有点暴力- 还好ss ...

  4. Microsoft Build 2016

    Microsoft Build 2016 Day 1 记录   去年今日:Microsoft Build 2015 汇总 今年的 Bulid 时间是 3.30-4.1,第一天的主角主要是 Window ...

  5. 使用psftp.exe

    使用psftp.exe 点击打开psftp.exe,出现如下图的命令窗口.  

  6. UI僵死分析

    原因剖析 UI僵死无非只是因为UI线程因繁忙而无法去接受用户的响应.详细说来内在原因有以下两个: 正常的业务代码写在UI线程中执行,业务代码的任务繁重导致UI线程无法分身去接受用户的界面输入 UI控件 ...

  7. 【译】使用微软企业库5.0进行WCF服务边界上的异常保护

    在Windows Communication Foundation (WCF)中,为了阻止服务的实现细节从服务的安全边界泄露,未知的异常不应该被发送至客服端.在WCF配置中将<serviceDe ...

  8. javascript - 浏览TOM大叔博客的学习笔记

    part1 ---------------------------------------------------------------------------------------------- ...

  9. 要引入java吸管工具

    Java调用颜色选择器robot方法getPixelColor让我们来看看下面的方法robot详细的实施类方法中,例如,下面的 getPixelColor public Color getPixelC ...

  10. MVC json

    1. .net MVC中Controller 在mvc中所有的controller类都必须使用"Controller"后缀来命名 并且对Action也有一定的要求: 必须是一个pu ...