ZOJ 2970Faster, Higher, Stronger
来源:互联网 发布:淘宝买家等级提升 编辑:程序博客网 时间:2024/05/29 13:21
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
简单题
#include<map>#include<ctime>#include<cmath> #include<queue> #include<string>#include<vector>#include<cstdio> #include<cstring> #include<iostream>#include<algorithm> using namespace std;#define ms(x,y) memset(x,y,sizeof(x)) #define rep(i,j,k) for(int i=j;i<=k;i++) #define per(i,j,k) for(int i=j;i>=k;i--) #define loop(i,j,k) for (int i=j;i!=-1;i=k[i]) #define inone(x) scanf("%d",&x) #define intwo(x,y) scanf("%d%d",&x,&y) #define inthr(x,y,z) scanf("%lf%lf%lf",&x,&y,&z) typedef long long LL;const int low(int x) { return x&-x; }const int INF = 0x7FFFFFFF;const int mod = 1e9 + 7;const int N = 1e5 + 10;int T, n, m, x;char s[N];int main(){for (inone(T); T--;){scanf("%s", s);intwo(n, m);rep(i, 2, n){inone(x);m = s[0] == 'F' ? min(m, x) : max(m, x);}printf("%d\n", m);}return 0;}
- 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浙江省赛】
- zoj2970----------------Faster, Higher, Stronger
- Faster, Higher, Stronger
- zoj2970 Faster, Higher, Stronger
- ZOJ2970-Faster, Higher, Stronger
- ZJU oj 2970 Faster, Higher, Stronger(水题)
- F - Faster, Higher, Stronger --- (first qualifying)
- 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
- Linux与Windows的不同
- hibernate表与表之间一对多关系配置初体验
- ZOJ 2969Easy Task
- 将一个字符串中的空格替换成“ %20”
- HM编码器代码阅读(40)——帧内预测的总结
- ZOJ 2970Faster, Higher, Stronger
- prim队列优化模板
- 0C——2.面向对象
- 字符界面的优势
- C#搭建三层架构
- 安卓开源项目周报0215
- ZOJ 2971Give Me the Number
- 过滤器、监听器、批量操作、文件上传下载
- BZOJ2038【莫队算法】