initial commit

This commit is contained in:
ShazidMahsrafi 2023-07-26 00:24:43 +06:00
parent 67b6a1406c
commit 5b5dd3699d

View File

@ -0,0 +1,35 @@
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n;
cin>>n;
set<int>s;
for(int i=0; i<n; ++i)
{
int x;
cin>>x;
s.insert(x);
}
if(s.size()==1)
cout<<"NO"<<endl;
else
{
auto it=++s.begin();
cout<<*it<<endl;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
//cin >> TC;
//cin.ignore();
while (TC--) solve();
}