Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97331 | Kevin | 19众数 | C++ | Accepted | 6 MS | 376 KB | 281 | 2024-11-13 16:11:30 |
#include<bits/stdc++.h> using namespace std; int n,a[100005],b[1005]; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; b[a[i]]++; } int max=0,xuhao; for(int i=1;i<=1000;i++){ if(max<b[i]){ max=b[i]; xuhao=i; } } cout<<xuhao; return 0; }