提交时间:2023-02-02 16:02:32
运行 ID: 68141
#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; }