QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#491843 | #4592. Theramore | fractal# | AC ✓ | 16ms | 3820kb | C++17 | 498b | 2024-07-25 23:14:23 | 2024-07-25 23:14:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve() {
string s, was[2];
cin >> s;
for (int i = 0; i < s.size(); ++i) {
was[i & 1] += s[i];
}
sort(was[0].begin(), was[0].end());
sort(was[1].begin(), was[1].end());
for (int i = 0; i < s.size(); ++i) {
cout << was[i&1][i / 2];
}
cout << '\n';
}
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int t = 1;
cin >> t;
while (t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 16ms
memory: 3820kb
input:
10 101001 01101100000000101010 11100100010110110011101010011111111010110100011100000001101011111001101000001010101001101101010011100101001000001011111011010001111110100101100010111110011000000101110110110001010100110001000110001101110011001101101101011000011010011010101111010010111010001001010111111...
output:
001011 00000000001010101111 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
result:
ok 10 lines