Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139306 邹金行 19选班长 C++ Wrong Answer 0 MS 268 KB 317 2025-12-06 14:12:53

Tests(1/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n; int max=-1,max_i=-1; cin>>n; int p[n+1]; int a,b,c; for(int i=1;i<=n;i++){ cin>>a>>b>>c; p[a]++; p[b]++; p[c]++; } for(int i=1;i<=n;i++){ if(p[i]>max){ max=p[i]; max_i=i; } } cout<<max_i; return 0; }


Run Info:

------Input------
7 4 4 1 7 2 4 3 1 3 5 2 1 1 6 6 6 6 5 3 4 1
------Answer-----
1
------Your output-----
2