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 }