F - Faster, Higher, Stronger --- (first qualifying)
来源:互联网 发布:一键java环境 编辑:程序博客网 时间:2024/05/18 00:56
问题描述
In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China and Beijing Olympics is to be a festival for people all over the world as well.
The motto of Olympic Games is "Citius, Altius, Fortius", which means "Faster, Higher, Stronger".
In this problem, there are some records in the Olympic Games. Your task is to find out which one is faster, which one is higher and which one is stronger.
输入
Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 50) which is the number of test cases. And it will be followed by T consecutive test cases.
Each test case has 3 lines. The first line is the type of the records, which can only be "Faster" "Higher" or "Stronger". The second line is a positive integer N meaning the number of the records in this test case. The third line has N positive integers, i.e. the records data. All the integers in this problem are smaller than 2008.
输出
Results should be directed to standard output. The output of each test case should be a single integer in one line. If the type is "Faster", the records are time records and you should output the fastest one. If the type is "Higher", the records are length records. You should output the highest one. And if the type is "Stronger", the records are weight records. You should output the strongest one.
样例输入
3Faster310 11 12Higher43 5 4 2Stronger2200 200
样例输出
105200
分析:太水了,不多说,就是简单的求最值问题。
CODE:
<span style="font-size:24px;">#include <string.h>#include <iostream>using namespace std;int main(){ int t; cin>>t; while(t--){ string s; cin>>s; int n,a,maxx=-3000,minn=3000; cin>>n; for(int i=0;i<n;i++){ cin>>a; if(a>maxx) maxx=a; if(a<minn) minn=a; } if(s=="Faster") cout<<minn<<endl; else cout<<maxx<<endl; } return 0;}</span>
- F - Faster, Higher, Stronger --- (first qualifying)
- zoj2970----------------Faster, Higher, Stronger
- Faster, Higher, Stronger
- zoj2970 Faster, Higher, Stronger
- ZOJ2970-Faster, Higher, Stronger
- ZOJ 2970 Faster, Higher, Stronger
- zoj-2970-Faster, Higher, Stronger
- ZOJ 2970Faster, Higher, Stronger
- ZOJ 2970 Faster, Higher, Stronger(排序)
- [查找最大最小]ZOJ 2970 Faster, Higher, Stronger
- ZOJ-2970-Faster, Higher, Stronger【5th浙江省赛】
- ZJU oj 2970 Faster, Higher, Stronger(水题)
- 2014ACM集训13级PK赛5-Faster, Higher, Stronger
- The 5th Zhejiang Provincial Collegiate Programming Contest---ProblemF:Faster, Higher, Stronger
- YOLO9000: Better, Faster, Stronger
- YOLO9000: Better,Faster,Stronger
- YOLO9000: Better, Faster, Stronger
- F: Baldheaded stronger
- html切换效果
- Climbing Stairs
- 关于 jspx 文件的一些说明
- HDU 1232 - 并查集 解题报告
- 在app上传遇到的头疼的问题ITMS-90071解决方案
- F - Faster, Higher, Stronger --- (first qualifying)
- 仿qq底部的提示标记
- listview中的textview如何自动跑马灯
- maven 常用命令
- CXF实战之集成Spring(三)
- iOS方法和实例变量
- WPF MVVM绑定DateGrid的列的显隐性解决方案
- Spring配置事务中的 transactionAttributes 各属性含义
- css 网站大背景(按比例缩放背景图片)