Advertisement
momo2345

second order statistics

Aug 11th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. // ********* Assalamualaikum****** IN the name of my Almighty****:):)***
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
  5. #define endl "\n"
  6. #define f(i,a,b) for(int i=a;i< b;i++)
  7. #define ff(i,a,b) for(int i= a;i>=b;i--)
  8. #define T int t; cin >>t; while(t--)
  9. #define vi vector<int>
  10. #define vll vector<long long>
  11. #define vs vector<string>
  12. #define vp vector<pair
  13. #define pii pair<int,int>
  14. #define pb push_back
  15. #define mk make_pair
  16. #define b(a) a.begin(),a.end()
  17. #define rb(a) a.rbegin(),a.rend()
  18. #define I int
  19. #define ll long long
  20. #define st string
  21. #define C char
  22. #define mn int main()
  23. #define fa(u,v) for(auto u:v)
  24. mn
  25. {
  26. suni;
  27. I n;
  28. cin>>n;
  29. set<I>s;
  30. I a[n];
  31. f(i,0,n)
  32. {
  33. cin>>a[i];
  34. s.insert(a[i]);
  35. }
  36. if(s.size()==1) cout<<"NO"<<endl;
  37. else cout<<*(++s.begin())<<endl;
  38.  
  39.  
  40.  
  41.  
  42. /* I n;
  43. cin>>n;
  44. vi v;
  45. I a[n];
  46. f(i,0,n)
  47. {
  48. cin>>a[i];
  49. v.pb(a[i]);
  50. }
  51. sort(b(v));
  52. I p=unique(b(v))-begin(v);
  53. if(p==1) cout<<"NO"<<endl;
  54. else cout<<v[1]<<endl;*/
  55.  
  56.  
  57. }
  58. //*******Happy Coding*******???******
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement