| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 71778 | 牛延希 | 19老李吃水果 | C++ | Wrong Answer | 1 MS | 272 KB | 397 | 2024-04-27 16:44:19 |
# include<iostream> # include<algorithm> using namespace std; int main(){ int k,n,a[10001],s=1,maxx=-1; cin>>k; while(k--){ cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; maxx=max(maxx,a[i]); }for(int i=0;i<n;i++){ if(a[i]==a[i+1] && a[i]==maxx) s++; }if(s>=(n+1)/2) cout<<"N"<<endl; else cout<<"Y"<<endl; } return 0; }
------Input------
5 6 1 2 4 2 2 4 5 1 1 1 2 1 5 1 1 1 2 1 5 1 1 1 2 1 5 1 1 1 2 1
------Answer-----
Y N N N N
------Your output-----
Y Y Y Y Y