1653: Champion of the Swordsmanship
1653: Champion of the Swordsmanship
Time Limit: 1 Sec Memory Limit: 64 MB
Submit: 11 Solved: 8
[Submit][Status][Web Board]
Description
In Zhejiang University, there is a famous BBS named Freecity. Usually we call it 88.

Recently some students at the Humour board on 88 create a new game - Swordsmanship. Different from the common sword fights, this game can be held with three players playing together in a match. Only one player advances from the match while the other two are eliminated. Sometimes they also hold a two-player match if needed, but they always try to hold the tournament with as less matches as possible.
(最近,一些学生在幽默板上创造了一个新的游戏——剑术。与普通的剑战不同,这款游戏可以与三名玩家在一场比赛中一起玩。只有一名球员在比赛中取得进步,而另外两名则被淘汰。有时,如果需要的话,他们也会举办双人赛,但他们总是尽量少赛。)Input
The input contains several test cases. Each case is specified by one positive integer n (0 < n < 1000000000), indicating the number of players. Input is terminated by n=0.
Output
For each test case, output a single line with the least number of matches needed to decide the champion.
Sample Input
3
4
0
Sample Output
1
2
#include<stdio.h>
int main()
{
int n,m,k;
while(scanf("%d",&n)&&n!=0)
{
if(n%2==0)
printf("%d\n",n/2);
else
printf("%d\n",(n-1)/2);
}
}
1653: Champion of the Swordsmanship的更多相关文章
- zoj 2830 Champion of the Swordsmanship
Champion of the Swordsmanship Time Limit: 2 Seconds Memory Limit: 65536 KB In Zhejiang Universi ...
- 1653: [Usaco2006 Feb]Backward Digit Sums
1653: [Usaco2006 Feb]Backward Digit Sums Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 285 Solved: ...
- CodeForces - 1087F:Rock-Paper-Scissors Champion(set&数状数组)
n players are going to play a rock-paper-scissors tournament. As you probably know, in a one-on-one ...
- 【BZOJ】1653: [Usaco2006 Feb]Backward Digit Sums(暴力)
http://www.lydsy.com/JudgeOnline/problem.php?id=1653 看了题解才会的..T_T 我们直接枚举每一种情况(这里用next_permutation,全排 ...
- 2017南宁现场赛E The Champion
Bob is attending a chess competition. Now the competition is in the knockout phase. There are 2^r2r ...
- we are the champion!!!!
- 2015 "BestCoder Cup" Champion
这场比赛我没有参加,不过就算参加了也估计是被完虐.于是看着题解把大部分题目都搞了一遍. T1:Movie(hdu 5214) 题目大意: 给出N个区间,问能否选出3个互不相交的区间. N<=10 ...
- 种树 (codevs 1653) 题解
[问题描述] 一条街的一边有几座房子.因为环保原因居民想要在路边种些树.路边的地区被分割成块,并被编号为1..n.每个块大小为一个单位尺寸并最多可种一棵树.每个居民想在门前种些树并指定了三个号码b,e ...
- BZOJ 1653 [Usaco2006 Feb]Backward Digit Sums ——搜索
[题目分析] 劳逸结合好了. 杨辉三角+暴搜. [代码] #include <cstdio> #include <cstring> #include <cmath> ...
随机推荐
- kuangbin带你飞 - 合集
[题目列表] 之前有一些做过了的,这次从数论开始?
- iOS 中使用 MJExtension 遇到 关键字(id) 怎么办
MJExtension 是个人比较喜欢用的json 转model 的软件,当遇到系统关键字时就会出现崩溃,解决方式如下 1.建立Modle 解析类,服务返回数据中带有id,这个时候用字典转Mode(m ...
- SourceTree切换语言
点击ok,重启SourceTree即生效 over!over!over!
- Weekly Contest 78-------->809. Expressive Words (stack)
Sometimes people repeat letters to represent extra feeling, such as "hello" -> "he ...
- Bloomberg Desktop Api 关于历史Tick数据的一些参考
使用WAPI命令可以看到当前BBG的Api情况. 目前2016年3月是V3的版本.其中有一个API Develper's Guide 中有Core Develper Guide的pdf, 里面提到了B ...
- [HNOI2010] 平面图判定 planar
标签:二分图判定.题解: 首先可以把题目中给你的那个环给画出来,这样就可以发现对于任意一个图来说,如果两条边要相交,就不能让他们相交,那么这两条边就要一条在里面一条在外面,如果把环画成一条链,那么就是 ...
- RN初始化项目报错
解决方法:全局删除yarn
- tree(2018.10.26)
题意:给你一颗树,树上每个节点都有一个权值,多次询问树上的一条链的严格上升子序列长度 这道题是个神奇的倍增,先记录\(fa[x][0]\)为\(x-root\)路径上第一个权值比他大的点,然后顺便处理 ...
- python如何永久添加模块搜索路径
win10系统 依次点击:控制面板\系统和安全\系统\高级系统设置\环境变量 找不到的话,直接在设置中搜索 环境变量 也一样 此时上面是用户变量 下面是系统变量 在系统变量中找到PYTHO ...
- python模块之hmac
# hmac模块使用步骤: # hmac模块模块的使用步骤与hashlib模块的使用步骤基本一致,只是在第1步获取hmac对象时,只能使用hmac.new()函数, # 因为hmac模块没有提供与具体 ...