Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122917 王子涵 19众数 C++ Accepted 5 MS 276 KB 273 2025-06-22 09:34:18

Tests(11/11):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,a[1001]={0},max=0,xb; cin>>n; for(int i=1;i<=n;i++) { cin>>xb; a[xb]++; } for(int j=1;j<=1000;j++) { if(a[j]>max) { max=a[j]; xb=j; } } cout<<xb; return 0; }