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. Linux环境编程之同步(二):条件变量

    相互排斥锁用于上锁,条件变量则用于等待.条件变量是类型为pthread_cond_t的变量.一般使用例如以下函数: #include <pthread.h> int pthread_con ...

  2. OCP-1Z0-051-题目解析-第30题

    30. Evaluate the following CREATE TABLE commands: CREATE TABLE orders (ord_no NUMBER(2) CONSTRAINT o ...

  3. Oracle中decode函数 列变成行

    create table t_class(c_Id  number(10) primary key ,stuName varchar2(50),  --人名c_Name varchar2(50),   ...

  4. Windows phone 8 学习笔记(6) 多任务

    原文:Windows phone 8 学习笔记(6) 多任务 Windows phone 8 是一个单任务操作系统,任何时候都只有一个应用处于活跃状态,这里的多任务是指对后台任务的支持.本节我们先讲讲 ...

  5. HttpDNS 服务详解(转)

    但凡使用域名来给用户提供服务的互联网企业,都或多或少地无法避免在有中国特色的互联网环境中遭遇到各种域名被缓存.用户跨网访问缓慢等问题.那么对于腾讯这样的域名数量在10万级别的互联网公司来讲,域名解析异 ...

  6. sublime text 2安装及使用

    1.首先下载Sublime Text:http://www.sublimetext.com/ 2.基本设置.參考此文:http://blog.jobbole.com/40660/ { "au ...

  7. hdu 1395 2^x mod n = 1 暴力过~~最好学下欧拉定理~~~

    2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  8. d3d纹理参数

    D3DTEXTURESTAGESTATETYPE 纹理状态定义了一个多层次的复杂的操作质感.一些采样工作状态设置顶点,有些组像素操作. 纹理层次状态可以快速保存并返回状态. typedef enum ...

  9. Ubuntu常用软件推荐,图文详细说明及下载

    抛开Windows,其实在任何一款Linux发行版本中,我们都有超级大量的软件来安装,使用.这次的教程,我就以Ubuntu为例,来给大家推荐一些我认为不错的软件 声明: 1.本文提到的全部软件,都在文 ...

  10. 阿里云server该数据光盘安装操作

    猛击这里:阿里云server该数据光盘安装操作