Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
68141 李言 寻找第二小的数 C++ 通过 100 0 MS 256 KB 408 2023-02-02 16:02:32

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int n,k,homo[114]; void check(){ int f=homo[1],ans=114; for(int i=2;i<=k;i++){ if(homo[i]!=f){ ans=homo[i]; cout<<ans<<endl; break; } } if(ans==114) cout<<"NO"<<endl; } int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>k; for(int j=1;j<=k;j++){ cin>>homo[j]; } sort(homo+1,homo+k+1); check(); } return 0; }


测评信息: