Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- using namespace std;
- int main()
- {
- optimize();
- int n;
- cin>>n;
- set<int>s;
- for(int i=0;i<n;i++)
- {
- int a;
- cin>>a;
- s.insert(a);
- }
- if(s.size()<=1) cout<<"NO\n";
- else cout<<*(++s.begin());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement