| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 149575 | 李昱龙 | 19选班长II | C++ | Accepted | 0 MS | 272 KB | 551 | 2026-03-14 14:48:01 |
#include<bits/stdc++.h> using namespace std; int a[5]; int main(){ int p,n,sum=0; while(1){ cin>>p; if(p==1){ a[1]++; } if(p==2){ a[2]++; } if(p==3){ a[3]++; } if(p==-1){ break; } sum++; } n=sum/2; cout<<"A="<<a[1]<<endl; cout<<"B="<<a[2]<<endl; cout<<"C="<<a[3]<<endl; cout<<"Tot="<<sum<<endl; if(a[1]>n){ cout<<"A-yes"; } else if(a[2]>n){ cout<<"B-yes"; } else if(a[3]>n){ cout<<"C-yes"; } else{ cout<<"all-NO"; } return 0; }