Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117332 李朋秦 19众数 C++ Accepted 7 MS 312 KB 466 2025-04-17 18:46:35

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 n,a[10001]={},m,max=0; cin>>n; for(int i=0;i<n;i++){ cin>>m; a[m]++; } for(int i=1;i<=1000;i++){ if(a[i]>a[max])max=i; } cout<<max; return 0; }