Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
68143 | 杨竣周 | 寻找第二小的数 | C++ | 通过 | 100 | 0 MS | 252 KB | 463 | 2023-02-02 16:04:30 |
#include <bits/stdc++.h> using namespace std; int n,a[11],m; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>m; for(int j=1;j<=m;j++){ cin>>a[j]; } sort(a+1,a+m+1); for(int j=1,c=a[1];j<=m;j++){ if(c!=a[j]){ cout<<a[j]; goto _; } c=a[j]; } cout<<"NO"; _:cout<<endl; } return 0; }