Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121940 翁思宸 19众数 C++ Accepted 9 MS 668 KB 527 2025-06-13 18:35:29

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; }