Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105848 | 饶晋吉 | 19选班长 | C++ | Wrong Answer | 1 MS | 272 KB | 325 | 2025-01-14 15:03:26 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n+1]; for(int i=1;i<6;i++){ a[i]=0; } for(int i=0;i<3*n;i++){ int m; cin>>m; a[m]++; } int max=1; for(int i=2;i<n;i++){ if(a[i]>a[max]){ max=i; } } cout<<max; return 0; }
------Input------
10 2 10 9 1 7 9 7 7 9 10 3 1 7 5 2 2 8 2 1 10 5 8 3 3 2 3 4 3 7 9
------Answer-----
2
------Your output-----
8