| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155514 | 邓弘锐 | 19众数 | C++ | Wrong Answer | 1 MS | 280 KB | 271 | 2026-06-07 14:38:15 |
#include<bits/stdc++.h> using namespace std; int a[10000]; int main(){ int x,b,c,n; cin>>n; for(int i=1;i<=n;i++){ cin>>x; a[x]++; } int max=a[1],s=1; for(int i=1;i<=n;i++){ if(max<a[i]){ max=a[i]; s=i; } } cout<<s; return 0; }
------Input------
5 888 888 999 999 3
------Answer-----
888
------Your output-----
3