| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 126895 | 张永良 | 19选班长II | C++ | Wrong Answer | 1 MS | 272 KB | 479 | 2025-07-22 14:09:37 |
#include <iostream> using namespace std; int main() { int a1=0,b=0,c=0,tot=0; for(int i=1;i<10000;i++){ int a; cin>>a; if(a==-1){ break; } tot++; if(a==1){ a1++; } if(a==2){ b++; } if(a==3){ c++; } } cout<<"A="<<a1<<endl<<"B="<<b<<endl<<"C="<<c<<endl<<"Tot="<<tot<<endl; if(a1*2>tot){ cout<<"A-Yes"; }else if(b*2>tot){ cout<<"B-Yes"; }else if(c*2>tot){ cout<<"C-Yes"; }else{ cout<<"all-NO"; } return 0; }
------Input------
1 3 3 3 3 3 1 4 3 4 2 3 2 1 4 1 3 1 1 3 3 3 3 -1
------Answer-----
A=6 B=2 C=12 Tot=23 C-yes
------Your output-----
A=6 B=2 C=12 Tot=23 C-Yes