ZOJ2970-Faster, Higher, Stronger
来源:互联网 发布:手机怎么开淘宝网店 编辑:程序博客网 时间:2024/06/05 15:40
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.
Input
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.
Output
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.
Sample Input
3Faster310 11 12Higher43 5 4 2Stronger2200 200
Sample Output
105200
Author: XUE, Zaiyue
Source: The 5th Zhejiang Provincial Collegiate Programming Contest
题意:给出一个字符串和n个数,如果字符串是Faster,就输出最小数,否则输出最大数
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <queue>#include <vector>#include <set>#include <stack>#include <map>#include <climits>using namespace std;#define LL long longint main(){ int a[3000],n; string s; int t; scanf("%d",&t); while(t--) { cin>>s; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+1+n); if(s=="Faster") printf("%d\n",a[1]); else printf("%d\n",a[n]); } return 0;}
- zoj2970----------------Faster, Higher, Stronger
- zoj2970 Faster, Higher, Stronger
- ZOJ2970-Faster, Higher, Stronger
- Faster, Higher, Stronger
- ZOJ 2970 Faster, Higher, Stronger
- zoj-2970-Faster, Higher, Stronger
- ZOJ 2970Faster, Higher, Stronger
- F - Faster, Higher, Stronger --- (first qualifying)
- 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
- 【笔记】YOLO9000: Better, Faster, Stronger
- ZOJ2966-Build The Electric System
- linux命令useradd添加用户详解
- ARM开发各种烧写文件格式说明(ELF、HEX、BIN)
- 调整数组顺序使奇数位于偶数前面
- 【实战】词频统计及词云图制作
- ZOJ2970-Faster, Higher, Stronger
- 机器学习三种数据集的作用
- 进程和线程的区别
- HDU1166敌兵布阵 简单线段树
- 理解Java的三大特性之封装
- KBEngine服务器demo中的AI(人工智能)
- 学好数据库,看这9本书就够了
- HDU1754 I Hate It 简单线段树
- android: binder: error log: binder_alloc_buf, no vma