http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2970

唔。。。第二水题。除了Faster是输出最小外,另外两个都是输出最大的。

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
    int t,i;
    string s;
    int n,a[10001];
    cin>>t;
    while(t--) {
        cin>>s>>n;
        for(i=0; i<n; i++)
            cin>>a[i];
        sort(a,a+n);
        if(s[0]=='F')
            cout<<a[0]<<endl;
        else
            cout<<a[n-1]<<endl;
    }
    return 0;
}

 

相关文章:

  • 2022-02-05
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
猜你喜欢
  • 2022-12-23
  • 2021-09-05
  • 2021-12-30
  • 2022-02-09
  • 2022-01-26
  • 2021-12-06
  • 2021-08-13
相关资源
相似解决方案