Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123300 张暄浩 19众数 C++ Accepted 6 MS 664 KB 537 2025-06-28 18:02:49

Tests(11/11):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[100001]={0},n,x=0,max=0,max_i=0; cin>>n; for(int i=1;i<=n;i++){ cin>>x; a[x]++; } for(int j=1;j<=1000;j++){ if(a[j]>max){ max=a[j]; max_i=j; } } cout<<max_i; return 0; }