Advertisement
sajid161

9:6

Jan 6th, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  3. using namespace std;
  4. int main()
  5. {
  6.     optimize();
  7.     int n;
  8.     cin>>n;
  9.     set<int>s;
  10.     for(int i=0;i<n;i++)
  11.     {
  12.         int a;
  13.         cin>>a;
  14.         s.insert(a);
  15.     }
  16.     if(s.size()<=1) cout<<"NO\n";
  17.     else cout<<*(++s.begin());
  18.  
  19. }
  20.  
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement