| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 84526 | 何思佳 | 19选班长II | C++ | Accepted | 1 MS | 272 KB | 469 | 2024-07-16 09:52:30 |
#include<bits/stdc++.h> using namespace std; int tong[4]; int main(){ int tot=0; int p; while(1){ cin>>p; if(p==-1){ break; } tot++; if(p>=1&&p<=3){ tong[p]++; } } cout<<"A="<<tong[1]<<endl; cout<<"B="<<tong[2]<<endl; cout<<"C="<<tong[3]<<endl; cout<<"Tot="<<tot<<endl; double kl=tot/2; for(int i=1;i<=3;i++){ if(tong[i]>kl){ cout<<(char)(i+64)<<"-"<<"yes"; return 0; } } cout<<"all-NO"; return 0; }