Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105799 | 李谨睿 | 19选班长II | C++ | Wrong Answer | 1 MS | 276 KB | 613 | 2025-01-14 14:15:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int A=0; int B=0; int C=0; int t=0; for(int i=1;i<10000;i++){ int a; cin>>a; if(a==-1){ break; } t++; if(a==1){ A++; } if(a==2){ B++; } if(a==3){ C++; } } cout<<"A="<<A<<endl; cout<<"B="<<B<<endl; cout<<"C="<<C<<endl; cout<<"Tot="<<t<<endl; int f=0; if(A>=t/2){ f=1; } if(B>=t/2){ f=2; } if(C>=t/2){ f=3; } if(f==0){ cout<<"all-NO"; } if(f==1){ cout<<"A-Yes"; } if(f==2){ cout<<"B-Yes"; } if(f==3){ cout<<"C-Yes"; } 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 C-Yes