| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155055 | 王培用 | 19众数 | C++ | Accepted | 7 MS | 380 KB | 334 | 2026-05-31 12:53:44 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[100000] ; for (int i = 0; i <n; i++) { cin>>a[i]; } int b[1001]={0}; for(int i=0;i<n;i++){ int x=a[i]; b[x]++; } int m = 1; for (int i = 2; i <= 1000; i++) { if (b[i] > b[m]) { m = i; } } cout << m; return 0; }