Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77347 杨一诺 19选班长II C++ Wrong Answer 0 MS 268 KB 859 2024-06-08 21:51:18

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int a,b,c,d,n=1; int main(){ while(d!=-1){ cin>>d; if(d==1){ a++; } if(d==2){ b++; } if(d==3){ c++; } n+=1; } if((n-2)%2!=0){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<n<<endl; cout<<"all"<<'-'<<"NO"<<endl; } if(a>=(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<n<<endl; cout<<"A"<<'-'<<"yes"<<endl; } if(b>=(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<n<<endl; cout<<"B"<<'-'<<"yes"<<endl; } if(c>=(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<n<<endl; cout<<"C"<<'-'<<"yes"<<endl; } }


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