Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159894 杨正蠔 19选班长II C++ Wrong Answer 1 MS 660 KB 803 2026-09-12 09:43:20

Tests(3/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int A=0,B=0,C=0,max,x,p,n,Tot=0,i=1; int a[100000]={}; while(1){ cin>>n; if(n==-1)break; Tot+=1; a[n]++; } for(int i=1;i<=3;i++){ if(i==1)A=a[i]; else if(i==2)B=a[i]; else if(i==3)C=a[i]; } cout<<"A="<<A<<endl<<"B="<<B<<endl<<"C="<<C<<endl<<"Tot="<<Tot<<endl; for(int i=1;i<2;i++){ if(A>Tot/2)cout<<"A-Yes"; else if(B>Tot/2)cout<<"B-Yes"; else if(C>Tot/2)cout<<"C-Yes"; else cout<<"all-NO"; } 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 C-Yes