Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96762 令狐文丽 19众数 C++ Wrong Answer 2 MS 660 KB 288 2024-11-09 13:28:44

Tests(1/11):


Code:

#include<iostream> #include<cstdio> using namespace std; int main(){ int n,a[100001]={0},x,max=0,j;//x代表下标 cin>>n; for(int i=1;i<=n;i++){ cin>>x; a[x]++; } for(int i=1;i<=n;i++){ if(a[i]>max){ max = a[i]; j = i; } } cout<<j; return 0; }


Run Info:

------Input------
5 888 888 999 999 3
------Answer-----
888
------Your output-----
3