Run ID:140542

提交时间:2025-12-15 21:15:40

#include <iostream> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 1; i <= n; i++) { cin >> a[i]; } int s = 1001; int d[s]; for(int i = 1; i <= s; i++) { d[i] = 0; } for(int i = 1; i <= n; i++) { int f = a[i]; d[f] = d[f] + 1; } int j = 1; for(int i = 1; i <= s; i++) { if(d[i] > d[s]) { s = i; } } cout << j; return 0; }