| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 126905 | 何睿函 | 19选班长II | C++ | Wrong Answer | 1 MS | 272 KB | 553 | 2025-07-22 14:15:22 |
#include<bits/stdc++.h> using namespace std; int main() { int b[4]; for (int i = 1; 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"; }else{ if(b[2]>s){ cout<<"B-yes"; }else{ if(b[2]>s){ 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 all-NO