QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#49072 | #4592. Theramore | ckiseki# | AC ✓ | 28ms | 3848kb | C++ | 504b | 2022-09-19 13:44:18 | 2022-09-19 13:44:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t; cin >> t;
while (t--) {
string s; cin >> s;
vector<char> v[2];
for (size_t i = 0; i < s.size(); ++i)
v[i & 1].push_back(s[i]);
sort(v[0].begin(), v[0].end());
sort(v[1].begin(), v[1].end());
for (size_t i = 0; i < s.size(); ++i) {
cout << v[i & 1][i >> 1];
}
cout << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 28ms
memory: 3848kb
input:
10 101001 01101100000000101010 11100100010110110011101010011111111010110100011100000001101011111001101000001010101001101101010011100101001000001011111011010001111110100101100010111110011000000101110110110001010100110001000110001101110011001101101101011000011010011010101111010010111010001001010111111...
output:
001011 00000000001010101111 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
result:
ok 10 lines