| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 131773 | 刘益梵 | 19选班长 | C++ | Compile Error | 0 MS | 0 KB | 314 | 2025-10-01 15:52:09 |
#include<bits/stdc++.h> using namespace std; int a[10000]; int main(){ int n,P1,P2,P3; cin>>n; for(int i=1;i<=n;i++){ cin>>p1>>P2>>P3; a[p1]++; a[p2]++; a[p3]++; } int m=0; int mm; for(int i=1;i<=n,i++){ if(a[i]>m){ m=a[i]; mm=i; } } cout<<mm; return 0; }
Main.cc: In function 'int main()':
Main.cc:8:8: error: 'p1' was not declared in this scope
cin>>p1>>P2>>P3;
^
Main.cc:10:5: error: 'p2' was not declared in this scope
a[p2]++;
^
Main.cc:11:5: error: 'p3' was not declared in this scope
a[p3]++;
^
Main.cc:15:16: warning: left operand of comma operator has no effect [-Wunused-value]
for(int i=1;i<=n,i++){
^
Main.cc:15:23: error: expected ';' before ')' token
for(int i=1;i<=n,i++){
^
Main.cc:5:8: warning: unused variable 'P1' [-Wunused-variable]
int n,P1,P2,P3;
^