Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
68164 | 陈路垚 | 寻找第二小的数 | C++ | Wrong Answer | 0 | 0 MS | 256 KB | 366 | 2023-02-02 16:20:44 |
#include<bits/stdc++.h> using namespace std; int main(){ int c,n,a[20]; bool t; cin>>c; for(int i=1;i<=c;i++){ cin>>n; t=false; for(int j=1;j<=n;j++){ cin>>a[j]; } sort(a,a+n); for(int j=1;j<n;j++){ if(a[j]!=a[j+1]){ cout<<a[j+1]<<endl; t=true; break; } } if(t==false) cout<<"NO"<<endl; } return 0; }