Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
126901 | 黄思翔 | 19选班长II | C++ | Accepted | 1 MS | 272 KB | 536 | 2025-07-22 14:12:41 |
#include <bits/stdc++.h> using namespace std; int main() { int b[4]; for(int i=0;i<=4;i++){ b[i]=0; } int count=0; for (int i = 1; ; i++) { int x; cin>>x; if(x==-1){ break; } count++; b[x]++; } cout<<"A="<<b[1]<<endl; cout<<"B="<<b[2]<<endl; cout<<"C="<<b[3]<<endl; cout<<"Tot="<<count<<endl; int s=count/2; if(b[1]>s){ cout<<"A-yes"; } if(b[2]>s){ cout<<"B-yes"; } if(b[3]>s){ cout<<"C-yes"; } if(b[1]<=s&&b[2]<=s&&b[3]<=s){ cout<<"all-NO"; } return 0; }