| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 75966 | 何思佳 | 19选班长II | C++ | Wrong Answer | 1 MS | 276 KB | 476 | 2024-06-01 11:40:15 |
#include <bits/stdc++.h> using namespace std; int main () { int tong[4]={0}; 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<<tong[i]<<"-"<<"Yes"; return 0; } } 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 12-Yes