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

31
misc/chuyen-de-xau/b4.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <bits/stdc++.h>
using namespace std;
string S[100];
bool check(const string &a, const string &b) {
const string ab = a + b, ba = b + a;
if (stoi(ab) < stoi(ba))
return false;
return true;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("B4.INP", "r", stdin);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
string a;
cin >> a;
S[i] = a;
}
sort(S, S + n, check);
for (int i = 0; i < n; i++) {
cout << S[i];
}
cout << '\n';
}