大致题意:

网球比赛,n个參赛者,每场比赛每位选手b瓶水+裁判1瓶水,所有比赛每一个參赛者p条毛巾

每一轮比赛有2^k个人參加比赛(k为2^k<=n中k的最大值),下一轮晋级人数是本轮每场比赛的获胜者,还得加上n-k个人

求全部比赛完毕后所须要的水的数量和毛巾的数量

注: 如有疑问,请下方评论,本人一定具体解答

#include <bits/stdc++.h>

using namespace std;

int main()
{
int n,b,p;
while(~scanf("%d%d%d",&n,&b,&p))
{
int ans_p = n * p;
int ans_b = 0;
while(n!=1)
{
int tt = (int )(log(n)/log(2));
int k = pow(2,t);
int d = n - k;
ans_b += (2*b+1) * (k/2);
n = k/2 + d;
}
printf("%d %d\n",ans_b,ans_p);
}
return 0;
}

Codeforces Educational Codeforces Round 8 A. Tennis Tournament的更多相关文章

  1. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  2. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  3. Educational Codeforces Round 8 A. Tennis Tournament 暴力

    A. Tennis Tournament 题目连接: http://www.codeforces.com/contest/628/problem/A Description A tennis tour ...

  4. Codeforces CF#628 Education 8 A. Tennis Tournament

    A. Tennis Tournament time limit per test 1 second memory limit per test 256 megabytes input standard ...

  5. codeforces Educational Codeforces Round 5 A. Comparing Two Long Integers

    题目链接:http://codeforces.com/problemset/problem/616/A 题目意思:顾名思义,就是比较两个长度不超过 1e6 的字符串的大小 模拟即可.提供两个版本,数组 ...

  6. codeforces Educational Codeforces Round 16-E(DP)

    题目链接:http://codeforces.com/contest/710/problem/E 题意:开始文本为空,可以选择话费时间x输入或删除一个字符,也可以选择复制并粘贴一串字符(即长度变为两倍 ...

  7. Codeforces Educational Codeforces Round 15 E - Analysis of Pathes in Functional Graph

    E. Analysis of Pathes in Functional Graph time limit per test 2 seconds memory limit per test 512 me ...

  8. Codeforces Educational Codeforces Round 15 D. Road to Post Office

    D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standa ...

  9. Codeforces Educational Codeforces Round 15 C. Cellular Network

    C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard ...

随机推荐

  1. Angular 快速上手

    本文系 Angular 快速上手学习笔记 安装 CLI npm install -g @angular/cli 创建工作空间和初始应用 ng new my-app 启动开发服务器 cd my-app ...

  2. 10个关于Android开发的实用教程

    本文为致力于Android应用的开发人员精选了几个不错的实用教程,无论是初学者还是专业开发人员都应该能够从中获益.这些教程中有不少是关于绘图和地址服务运用的,另外一些则是SDK相关的.希望对大家有所帮 ...

  3. orale 中创建定时任务

    --添加变量 variable job1 number; --创建JOB begin   dbms_job.submit(:job1,'testjob;',sysdate, 'TRUNC(sysdat ...

  4. 【我所认知的BIOS】系列blog整理 1.23.2016.zip

    这几年来,蛮多小伙伴都给我发邮件拿PDF版本号. 几年前写的文章格式什么的实在是太粗糙.近期我把全部的文章都整理了一下.事实上该想法已经早就有了,仅仅是近期才開始空暇.如今我把全部的文章整理好了以后上 ...

  5. XMPP添加删除好友

    在现阶段的通信服务中.各种标准都有,因此会出现无法实现相互连通,而XMPP(Extensible Message and presence Protocol)协议的出现,实现了整个及时通信服务协议的互 ...

  6. 【RQNOJ】460 诺诺的队列

    [题目大意] 求全部数对(i,j)满足随意a[k]<=a[i]且a[k]<=a[j]. 形象地说,就是有一群人站成一列.每一个人有一定的身高,然后问有多少对人能够互相看得到. 把数对(i, ...

  7. vijos - P1543极值问题(斐波那契数列 + 公式推导 + python)

    P1543极值问题 Accepted 标签:[显示标签] 背景 小铭的数学之旅2. 描写叙述 已知m.n为整数,且满足下列两个条件: ① m.n∈1,2.-,K ② (n^ 2-mn-m^2)^2=1 ...

  8. 51nod-1273: 旅行计划

    [传送门:51nod-1273] 简要题意: 给出一棵树,点数为n,现在你有一个旅行计划,从k城市出发,每天前往一个没去过的城市,并且旅途中经过的没有去过的城市尽可能的多(如果有2条路线,经过的没有去 ...

  9. m_Orchestrate learning system---二十五、复制类的时候最容易出现的错误是什么

    m_Orchestrate learning system---二十五.复制类的时候最容易出现的错误是什么 一.总结 一句话总结:命名空间错误导致Analyze类虽然继承了Base类,但是没有执行里面 ...

  10. hdoj--5256--序列变换(lis变形)

    序列变换 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi ...