| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 68258 | 董承诺 | 寻找第二小的数 | C++ | Accepted | 100 | 0 MS | 252 KB | 351 | 2023-02-03 16:55:09 |
#include<bits/stdc++.h> using namespace std; int a[11],b,c; int main(){ cin>>c; while(c--){ cin>>b; for(int i=1;i<=b;i++) cin>>a[i]; sort(a+1,a+1+b); int d=a[1],e=a[1]; for(int i=2;i<=b;i++){ if(a[i]!=d){ e=a[i]; break; } } if(d==e) cout<<"NO"<<endl; else cout<<e<<endl; } return 0; }