Run ID:159923

提交时间:2026-09-12 11:47:18

#include<iostream> #include<set> using namespace std; int main() { int c; cin >> c; while(c--) { int n; cin >> n; set<int> st; int x; for(int i=0; i<n; i++) { cin >> x; st.insert(x); } if(st.size() >= 2) { auto it = st.begin(); it++; // 跳到第二个元素 cout << *it << endl; } else { cout << "NO" << endl; } } return 0; }