Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2501 | 邓小龙 | 19选班长II | C++ | Wrong Answer | 0 MS | 276 KB | 660 | 2024-01-06 18:10:13 |
# include<iostream> # include<cstdio> # include<iomanip> using namespace std; int main(){ int a[4],b; double z=0.00; a[1]=0; a[2]=0; a[3]=0; while(1){ cin>>b; if(b==-1)break; else{ a[b]++; z++; } } cout<<"A="<<a[1]<<endl; cout<<"B="<<a[2]<<endl; cout<<"C="<<a[3]<<endl; cout<<"Tot="<<z<<endl; z=z/2; if(a[1]<=z&&a[2]<=z&&a[3]<=z) { cout<<"all-NO"<<endl; } else{ for(int j=1;j<=3;j++){ if(a[j]>z){ cout<<j<<endl; } } } 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 3