CodeForces - 22A Second Order Statistics【水题】

题目链接:https://codeforces.com/contest/22/problem/A

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> v;
int n;
int main()
{scanf("%d",&n);for(int i=0;i<n;i++){int x;scanf("%d",&x);v.push_back(x);}sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end());if(v.size()<2) puts("NO");else printf("%d\n",v[1]);return 0;
}

本文链接:https://my.lmcjl.com/post/5954.html

展开阅读全文

4 评论

留下您的评论.