Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88073 王馨桐 19众数 C++ Accepted 5 MS 276 KB 267 2024-08-17 12:11:21

Tests(11/11):


Code:

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