Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160869 万骏博 19众数 C++ Accepted 9 MS 268 KB 277 2026-09-26 16:10:59

Tests(11/11):


Code:

#include<bits/stdc++.h> using namespace std; int n,m,a[1001000],l=0,o=0,p=0; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>m; a[m]++; if(p<m){ p=m; } } for(int i=1;i<=p;i++){ if(a[i]>l){ l=a[i]; o=i; } } cout<<o; return 0; }