| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 159892 | 杨正蠔 | 19选班长II | C++ | Wrong Answer | 1 MS | 664 KB | 934 | 2026-09-12 09:40:03 |
#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; }
------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=44 all-No