some programs!

This commit is contained in:
rogerwang2008 committed 2026-09-25 20:20:01 +08:00
1 parent 5d30e847c1
commit ed054247d5
32 files changed
+1882 -149

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
#include <iostream>
using namespace std;
constexpr int MAX_X = 15;
int n, winner;
unsigned int bucket[MAX_X + 1];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int _ = 0; _ < n; _++) {
int x;
cin >> x;
bucket[x]++;
}
winner = 0;
for (int x = 1; x <= MAX_X; x++) {
if (bucket[x] > bucket[winner]) {
winner = x;
}
}
cout << winner << endl;
return 0;
}