Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152538 徐英杰 19选班长II C++ Wrong Answer 1 MS 264 KB 739 2026-04-26 15:18:52

Tests(0/10):


Code:

#include<iostream> using namespace std; int a[1000001]; int main() { //桶:按照某种性质将数据分组,满足相同性质的数据,放入同一个容器 //桶的作用1:统计满足某种性质的数据个数 // int cntA = 0; // int cntB = 0; // int cntC = 0; int tot = 0; int x; for (;;) { cin>>x; if (x == -1) { break; } tot++; a[x]++; } if (a[1] > tot/2) { cout<<"A-yes\n"; return 0; } if (a[2] > tot/2) { cout<<"B-yes\n"; return 0; } if (a[3] > tot/2) { cout<<"C-yes\n"; return 0; } cout<<"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-----
all-NO