Precreation contest files

This commit is contained in:
2026-02-11 11:28:23 +07:00
parent 0a8ea477bb
commit cb9f7cab30
134 changed files with 1848 additions and 0 deletions

30
misc/chuyen-de-xau/b7.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include <bits/stdc++.h>
using namespace std;
int counter[(int)('z' - 'a')];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string a;
cin >> a;
for (const auto i : a) {
counter[i - 'a']++;
}
int sum = 0;
for (const auto i : counter) {
sum += i;
}
int max_x = 0;
char max_c;
for (int i = 0; i < 'z' - 'a'; i++) {
if (counter[i] > max_x) {
max_x = counter[i];
max_c = 'a' + i;
}
}
cout << sum << ' ' << max_c << '\n';
}