Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
104588 | 朱安然 | 19众数 | C++ | Accepted | 7 MS | 272 KB | 316 | 2025-01-05 14:34:13 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int b[1001]; for(int i=1;i<=1000;i++){ b[i]=0; } for(int i=0;i<n;i++){ int m; cin>>m; b[m]++; } int e=1; for(int i=1;i<=1000;i++){ if(b[i]>b[e]){ e=i; } } cout<<e; return 0; }