Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7097 | 吴承熹 | 19选班长II | C++ | Wrong Answer | 0 MS | 268 KB | 559 | 2025-04-05 09:27:05 |
#include<bits/stdc++.h> #include<cstdio> using namespace std; int main(){ int a[4]={}; int p,cnt=0; while(cin>>p,p!=-1){ a[p]++; cnt++; } int m=0; char w; for(int i=1;i<=3;i++){ if(a[i]>m){ m=a[i]; w='A'+i-1; } } cout<<"A="<<a[1]<<endl; cout<<"B="<<a[2]<<endl; cout<<"C="<<a[3]<<endl; cout<<"Tot="<<cnt<<endl; if(m>cnt/2){ cout<<w<<'-yes'<<endl; } else{ cout<<"all-NO"<<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 C762930547