Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152566 肖之睿 19选班长II C++ Wrong Answer 1 MS 268 KB 866 2026-04-26 15:52:57

Tests(0/10):


Code:

#include<iostream> using namespace std; int main() { int cnta=0; int cntb=0; int cntc=0; int x; int t; for(;;){ cin>>x; if(x==1){ cnta++; } if(x==2){ cntb++; } if(x==3){ cntc++; } if(x!=-1){ t=t+1; } if(x==-1){ break; } } if(cnta>t/2){ cout<<"A="<<cnta<<endl<<"B="<<cntb<<endl<<"C="<<cntc<<endl<<"Tot="<<t<<endl<<"A-yes"; return 0; }else if(cntb>t/2){ cout<<"A="<<cnta<<endl<<"B="<<cntb<<endl<<"C="<<cntc<<endl<<"Tot="<<t<<endl<<"B-yes"; return 0; }else if(cntc>t/2){ cout<<"A="<<cnta<<endl<<"B="<<cntb<<endl<<"C="<<cntc<<endl<<"Tot="<<t<<endl<<"C-yes"; return 0; }else{ cout<<"A="<<cnta<<endl<<"B="<<cntb<<endl<<"C="<<cntc<<endl<<"Tot="<<t<<endl<<"all-NO"; } return 0; }


Run Info:

------Input------
4 3 4 2 1 3 1 4 1 4 1 2 1 3 3 1 3 4 3 1 4 4 4 4 4 4 4 4 1 1 4 4 1 2 4 3 4 2 1 2 1 3 3 3 -1
------Answer-----
A=12 B=5 C=10 Tot=44 all-NO
------Your output-----
A=12 B=5 C=10 Tot=4195108 all-NO