http://codeforces.com/contest/22

A

水题

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define sqr(x) ((x)*(x))
 6 #define maxn 500005
 7 typedef long long ll;
 8 /*#ifndef ONLINE_JUDGE
 9         freopen("1.txt","r",stdin);
10 #endif */
11 
12 int a;
13 vector<int>ve;
14 
15 int main(){
16     #ifndef ONLINE_JUDGE
17        // freopen("1.txt","r",stdin);
18     #endif
19     std::ios::sync_with_stdio(false);
20     int n;
21     cin>>n;
22     for(int i=0;i<n;i++){
23         cin>>a;
24         ve.push_back(a);
25     }
26     sort(ve.begin(),ve.end());
27     ve.erase(unique(ve.begin(),ve.end()),ve.end());
28     if(ve.size()==1) cout<<"NO"<<endl;
29     else cout<<ve[1]<<endl;
30     
31 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2021-05-21
  • 2021-12-25
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案