| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 108741 | 陈铎文 | 19选班长II | C++ | Wrong Answer | 1 MS | 276 KB | 601 | 2025-01-21 15:51:59 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[10001],A=0,B=0,C=0,i=1,s=0; while(1){ cin>>a[i]; if(a[i]==-1) break; i++; s++; } for(int j=1;j<=s;j++){ if(a[j]==1) A++; else if(a[j]==2) B++; else if(a[j]==3) C++; } cout<<"A="<<A<<endl; cout<<"B="<<B<<endl; cout<<"C="<<C<<endl; cout<<"Tot="<<s<<endl; if(A > s/2){ cout<<"A-yes"<<endl; } else if(B > s/2){ cout<<"B-yes"<<endl; } else if(C > s/2){ cout<<"C-yes"<<endl; } else{ cout<<"all-NO"<<endl; } return 0; }
------Input------
4 3 4 2 1 3 1 4 1 4 1 2 1 3 3 1 3 4 3 1 4 4 4 4 4 4 4 4 1 1 4 4 1 2 4 3 4 2 1 2 1 3 3 3 -1
------Answer-----
A=12 B=5 C=10 Tot=44 all-NO
------Your output-----
A=12 B=5 C=10 Tot=43 all-NO