Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139314 邹金行 19众数 C++ Wrong Answer 0 MS 276 KB 289 2025-12-06 14:44:24

Tests(1/11):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n; int max=-1,max_i=-1; cin>>n; int p[n+1]={0}; int a; for(int i=1;i<=n;i++){ cin>>a; p[a]++; } 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------
5 888 888 999 999 3
------Answer-----
888
------Your output-----
3