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

38
misc/chuyen-de-xau/b5.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin >> s;
vector<char> digits;
for (char c : s) {
if (isdigit(c))
digits.push_back(c);
}
int m = digits.size();
string result = "";
int pos = 0;
for (int need = 5; need > 0; need--) {
char best = '0';
int bestPos = pos;
for (int i = pos; i <= m - need; i++) {
if (digits[i] > best) {
best = digits[i];
bestPos = i;
}
}
result.push_back(best);
pos = bestPos + 1;
}
cout << result;
return 0;
}