Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
116980 李明秦 19选班长II C++ Wrong Answer 1 MS 316 KB 548 2025-04-13 09:38:11

Tests(3/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int ar[10001]={},a=0,b=0,c=0,i=0,n=0,j; while(1){ cin>>ar[i]; if(ar[i]==-1)break; i++; n++; } for(j=0;j<n;j++){ if(ar[j]==1)a++; else if(ar[j]==2)b++; else if(ar[j]==3)c++; } cout<<"A="<<a<<endl; cout<<"B="<<b<<endl; cout<<"C="<<c<<endl; cout<<"Tot="<<n<<endl; if(a>n/2) cout<<"A-Yes"<<endl; else if(b>n/2) cout<<"B-Yes"<<endl; else if(a>n/2) cout<<"C-Yes"<<endl; else{ cout<<"all-NO"<<endl; } return 0; }


Run Info:

------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 all-NO