【CF MEMSQL 3.0 A. Declined Finalists】
time limit per test 2 seconds
memory limit per test 256 megabytes
input standard input
output standard output
This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each eligible contestant must either accept or decline the invitation. Whenever a contestant declines, the highest ranked contestant not yet invited is invited to take the place of the one that declined. This continues until 25 contestants have accepted invitations.
After the qualifying round completes, you know K of the onsite finalists, as well as their qualifying ranks (which start at 1, there are no ties). Determine the minimum possible number of contestants that declined the invitation to compete onsite in the final round.
Input
The first line of input contains K (1 ≤ K ≤ 25), the number of onsite finalists you know. The second line of input contains r1, r2, ..., rK(1 ≤ ri ≤ 106), the qualifying ranks of the finalists you know. All these ranks are distinct.
Output
Print the minimum possible number of contestants that declined the invitation to compete onsite.
Examples
input
25
2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 28
output
3
input
5
16 23 8 15 4
output
0
input
3
14 15 92
output
67
Note
In the first example, you know all 25 onsite finalists. The contestants who ranked 1-st, 13-th, and 27-th must have declined, so the answer is 3.
【翻译】一场比赛本来只选择排名前25位的人进入决赛。但是这些人可以有人弃权,如果一个人弃权,那么就在剩下没有入围的人中选出最高分并邀请他参加决赛。当然这个人也可以拒绝,那么就要一直重复上述过程。给出n个人的排名(1<=n<=25),且这n个人都进入决赛了,请求出满足这些人进决赛,最少有多少个人拒绝参加决赛。
题解:
①题意很难懂。
②转化后问题:给出n个数,求最大值,如果最大值大于25输出最大值-25的值,否则输出0。
#include<stdio.h>
using namespace std;
int n,a,b;
int main()
{
scanf("%d",&n);
while(n--)scanf("%d",&b),a=a<b?b:a;
printf("%d",a<25?0:a-25);return 0;
}//Paul_Guderian
【CF MEMSQL 3.0 A. Declined Finalists】的更多相关文章
- 【CF MEMSQL 3.0 E. Desk Disorder】
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- 【CF MEMSQL 3.0 C. Pie Rules】
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- 【CF MEMSQL 3.0 D. Third Month Insanity】
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- 【CF MEMSQL 3.0 B. Lazy Security Guard】
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- 【CF edu 27 G. Shortest Path Problem?】
time limit per test 3 seconds memory limit per test 512 megabytes input standard input output standa ...
- 【CF Round 439 E. The Untended Antiquity】
time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standa ...
- 【CF Round 439 C. The Intriguing Obsession】
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- 【CF Round 439 B. The Eternal Immortality】
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- 【Magicodes.IE 2.0.0-beta1版本发布】已支持数据表格、列筛选器和Sheet拆分
为了更好的完善Magicodes.IE,春节期间我们会进行一次大的重构.由于精力有限,急缺文档和翻译(将文档翻译为英文文档)支持,诚邀各位加入.同时在功能方便也做了相关规划,有兴趣的朋友可以参与提交P ...
随机推荐
- stata操作
//stata操作 *************************数据基本操作****************************** gen varname = value //定义变量 r ...
- Python的scrapy之爬取51job网站的职位
今天老师讲解了Python中的爬虫框架--scrapy,然后带领我们做了一个小爬虫--爬取51job网的职位信息,并且保存到数据库中 用的是Python3.6 pycharm编辑器 爬虫主体: im ...
- Logistic Regression学习笔记
1.李航<统计学习方法>: 2.https://blog.csdn.net/laobai1015/article/details/78113214 3.http://www.cnblogs ...
- 转译符,re模块,random模块
一, 转译符 1.python 中的转译符 正则表达式中的内容在Python中就是字符串 ' \n ' : \ 转移符赋予了这个n一个特殊意义,表示一个换行符 ' \ \ n' : \ \ 表示取 ...
- mysql5.7.19安装报错 无法定位程序输入点
https://blog.csdn.net/t876587201/article/details/79503688
- ffmpeg安装配置以及库调用
参考https://blog.csdn.net/jayson_jang/article/details/52329508 cd ffmpeg ./configure --enable-shared - ...
- Python字符串处理:过滤字符串中的英文与符号,保留汉字
使用Python 的re模块,re模块提供了re.sub用于替换字符串中的匹配项. re.sub(pattern, repl, string, count=0) 参数说明: pattern:正则重的模 ...
- list 集合addAll 和 add 方法小坑
1.问题 我们经常会遍历 list集合,在遍历的过程中,如果在遍历的过程中添加了 add() 或者 addAll() 方法修改了遍历的list列表,那么会报错. 代码演示: List<Inte ...
- PyQt的QString和python的string的区别
转载于http://blog.chinaunix.net/uid-200142-id-4018863.html python的string和PyQt的QString的区别 python string和 ...
- 自动化测试-selenium启动浏览器
在自动化测试过程中,通过selenium启动浏览器时,可能需要加载插件(如测试用的firebug.或产品中要求必须添加某插件等).读取用户数据(自己浏览器的配置文件/别人直接给的浏览器配置文件).设置 ...