Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
114517 | 李昊宇 | 19选班长II | C++ | Accepted | 1 MS | 272 KB | 649 | 2025-03-22 14:28:04 |
#include<iostream> using namespace std; int main(){ int A=0,B=0,C=0,Tot=0,p,z=0; for(int i=1;i<=10000;i++){ cin>>p; if(p==-1){ break; } if(p==1) A++; if(p==2) B++; if(p==3) C++; Tot++; } cout<<"A="<<A<<endl<<"B="<<B<<endl<<"C="<<C<<endl<<"Tot="<<Tot<<endl; if(A>Tot/2){ cout<<"A-yes"<<endl; } else if(B>Tot/2){ cout<<"B-yes"<<endl; } else if(C>Tot/2){ cout<<"C-yes"<<endl; } else { cout<<"all-NO"<<endl; } return 0; }