Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
68174 桑迪 寻找第二小的数 C++ 解答错误 0 0 MS 252 KB 351 2023-02-02 16:30:02

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int t,n,bot[120],in,tmp,ans; int main(){ cin>>t; while(t--){ memset(bot,0,sizeof bot); in=110,ans=-1; cin>>n; while(n--)cin>>tmp,bot[tmp]++,in=min(in,tmp); for(int i=in+1;i<=100;i++)if(bot[i]){ans=i;break;} if(ans+1)cout<<ans; else cout<<"NO"; cout<<"\n"; } return 0; }


测评信息: