| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 122280 | 王子涵 | 19选班长II | C++ | Accepted | 1 MS | 268 KB | 483 | 2025-06-15 09:55:48 |
#include<bits/stdc++.h> using namespace std; int main(){ int a=0,b=0,c=0,tot=0,bh; for(int i=1;i<=10000;i++) { cin>>bh; if(bh==-1) break; if(bh==1) a++; if(bh==2) b++; if(bh==3) c++; tot++; } cout<<"A="<<a<<endl; cout<<"B="<<b<<endl; cout<<"C="<<c<<endl; cout<<"Tot="<<tot<<endl; if(a*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; }