F - Faster, Higher, Stronger

Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu

Description

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

3
Faster
3
10 11 12
Higher
4
3 5 4 2
Stronger
2
200 200

Sample Output

10
5
200
题目意思:输入Faster的时候 输出最小的值,输入Higher和Stronger的时候输出最大的值
sort一下之后输出判断一下就ok了
 #include<iostream>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std;
int main()
{
int a;
scanf("%d",&a);
while(a--)
{
char b[];
scanf("%s",b);
int n,m[];
scanf("%d",&n);
for(int i=;i<n;i++)
{
scanf("%d",&m[i]);
}
sort(m,m+n);
if(!strcmp(b,"Faster"))
printf("%d\n",m[]);
if(!strcmp(b,"Higher")||!strcmp(b,"Stronger"))
printf("%d\n",m[n-]);
}
return ;
}

ZOJ 2970 Faster, Higher, Stronger的更多相关文章

  1. The 5th Zhejiang Provincial Collegiate Programming Contest---ProblemF:Faster, Higher, Stronger

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2970 唔...第二水题.除了Faster是输出最小外,另外两个都是输出最大 ...

  2. nenu contest3 The 5th Zhejiang Provincial Collegiate Programming Contest

    ZOJ Problem Set - 2965 Accurately Say "CocaCola"!  http://acm.zju.edu.cn/onlinejudge/showP ...

  3. 杭电ACM分类

    杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...

  4. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

  5. QDU_组队训练(ABEFGHKL)

    A - Accurately Say "CocaCola"! In a party held by CocaCola company, several students stand ...

  6. YOLO 论文阅读

    YOLO(You Only Look Once)是一个流行的目标检测方法,和Faster RCNN等state of the art方法比起来,主打检测速度快.截止到目前为止(2017年2月初),YO ...

  7. August 13th 2016 Week 33rd Saturday

    What makes life dreary is the want of motive. 没有目标与动力,生活便会郁闷无光. Without dreams and hope, there will ...

  8. SOME USEFUL MACHINE LEARNING LIBRARIES.

    from: http://www.erogol.com/broad-view-machine-learning-libraries/ http://www.slideshare.net/Vincenz ...

  9. 目标检测之YOLO V2 V3

    YOLO V2 YOLO V2是在YOLO的基础上,融合了其他一些网络结构的特性(比如:Faster R-CNN的Anchor,GooLeNet的\(1\times1\)卷积核等),进行的升级.其目的 ...

随机推荐

  1. go 流程控制

    if else 语句 基本语法 if condition { //do something } if condition { //do something } else if condition { ...

  2. 解决Win7&Win8 64位下Source Insight提示未完整安装的问题[转]

    转自:http://www.cnblogs.com/sixiweb/p/3421533.html 网上的破解版的注册表文件都是针对32位系统的,所以在64位系统里运行根本无法破解.下面分别贴出这俩系统 ...

  3. 一个不错的linux学习资料下载的网址

    本文比较完整的讲述GNU make工具,涵盖GNU make的用法.语法.同时重点讨论如何为一个工程编写Makefile.作为一个Linux程序员,make工具的使用以及编写Makefile是必需的. ...

  4. Tslib的移植【转】

    转自:http://www.cnblogs.com/uvsjoh/archive/2011/08/25/2152947.html移植Tslib 1 下载源码tslib-x.x.tar.gz 2 解压, ...

  5. Linux内核跟踪之ring buffer的实现【转】

      转自:http://blog.chinaunix.net/uid-20543183-id-1930845.html ---------------------------------------- ...

  6. 32 Profiling Go Programs 分析go语言项目

    Profiling Go Programs  分析go语言项目 24 June 2011 At Scala Days 2011, Robert Hundt presented a paper titl ...

  7. 栈应用之 背包问题(Python 版)

    栈应用之 背包问题 背包问题描述:一个背包里可以放入重量为weight的物品,现有n件物品的集合s,其中物品的重量为别为w0,w1,...,wn-1.问题是能否从中选出若干件物品,其重量之和正好等于w ...

  8. 数据库-mysql数据操作

    一:mysql 数据的插入 语法 以下为向MySQL数据表插入数据通用的 INSERT INTO SQL语法: INSERT INTO table_name ( field1, field2,...f ...

  9. 缓存数据库-redis数据类型和操作(set)

    一:Redis 集合(Set) Redis的Set是string类型的无序集合.集合成员是唯一的,这就意味着集合中不能出现重复的数据. Redis 中 集合是通过哈希表实现的,所以添加,删除,查找的复 ...

  10. node项目中用到的一些模块

    1.http模块,用来搭建服务器 代码,简单服务器实现 var http = require('http'); http.createServer(function (request, respons ...