| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146247 | 罗晟睿 | 19选班长II | C++ | Accepted | 0 MS | 280 KB | 486 | 2026-01-27 14:29:11 |
#include<bits/stdc++.h> using namespace std; int main() { int a,p1=0,p2=0,p3=0,tot=0; while(1) { cin>>a; if(a==-1)break; else if(a==1) p1++; else if(a==2) p2++; else if(a==3) p3++; tot++; } printf("A=%d\n",p1); printf("B=%d\n",p2); printf("C=%d\n",p3); printf("Tot=%d\n",tot); if(p1>tot/2.0) { cout<<"A-yes"; } else if(p2>tot/2.0) { cout<<"B-yes"; } else if(p3>tot/2.0) { cout<<"C-yes"; } else { cout<<"all-NO"; } return 0; }