Run ID:152538
提交时间:2026-04-26 15:18:52
#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; }