| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155194 | 赵奕杰 | 19选班长II | C++ | Wrong Answer | 1 MS | 272 KB | 468 | 2026-06-05 18:46:11 |
#include<bits/stdc++.h> using namespace std; int d[10005]; int main(){ int a=0,b=0,c=0,tot=0,max=0; for(int i=1;i<=10000;i++){ cin>>d[i]; if(d[i]==-1){ break; } if(d[i]==1) a++; else if(d[i]==2) b++; else if(d[i]==3) c++; tot++; } printf("A=%d\nB=%d\nC=%d\nTot=%d\n",a,b,c,tot); tot=double(tot)/2; if(a>tot) cout<<"A-yes"; else if(b>tot) cout<<"B-yes"; else if(c>tot)cout<<"C-yes"; else cout<<"all-No"; return 0; }
------Input------
4 3 4 2 1 3 1 4 1 4 1 2 1 3 3 1 3 4 3 1 4 4 4 4 4 4 4 4 1 1 4 4 1 2 4 3 4 2 1 2 1 3 3 3 -1
------Answer-----
A=12 B=5 C=10 Tot=44 all-NO
------Your output-----
A=12 B=5 C=10 Tot=44 all-No