| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 116977 | 李朋秦 | 19选班长II | C++ | Wrong Answer | 1 MS | 284 KB | 528 | 2025-04-13 09:37:31 |
#include<bits/stdc++.h> using namespace std; int main(){ int A[10001],a=0,b=0,c=0,i=0,n=0; while(1){ cin>>A[i]; if(A[i]==-1)break; i++; n++; } for(int j=0;j<n;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"<<n<<endl; if(a>n/2){ cout<<"A-Yes"<<endl; }else if(b>n/2){ cout<<"B-Yes"<<endl; }else if(c>n/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 Tot44 all-No