Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<bits/stdc++.h>#define pb push_backtypedef long long ll;using namespace std;typedef pair<int, int> pii;const int maxn = 1e3 + 10;string a;void solve() {cin >> a;set<char> se= {a[0], a[1], a[3], a[4], a[6], a[7] };vector<char> v;int sx = (a[0] - '0') * 10 + a[1] - '0';int sy = (a[3] - '0') * 10 + a[4] - '0';int sz = (a[6] - '0') * 10 + a[7] - '0';int s = (sx * 60 + sy) * 60 + sz;//cout << sx << " " << sy << " " << s <<endl;int res = INT_MAX, r1, r2, r3;for (char t : se) v.push_back(t);if(v.size() == 1) {cout << a << endl;return;}for (int i = 0; i < v.size(); i++) {for (int j = 0; j < v.size(); j++) {for (int x = 0; x < v.size(); x++) {for (int y = 0; y < v.size(); y++) {for (int cx = 0; cx < v.size(); cx++) {for (int cy = 0; cy < v.size(); cy++) {int tx = (v[i] - '0') * 10 + v[j] - '0';int ty = (v[x] - '0') * 10 + v[y] - '0';int tz = (v[cx] - '0') * 10 + v[cy] - '0';