QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#460584 | #8829. Aibohphobia | QwertyPi# | WA | 1ms | 3544kb | C++14 | 673b | 2024-07-01 21:12:38 | 2024-07-01 21:12:40 |
Judging History
answer
#include <bits/stdc++.h>
#define all(a) begin(a), end(a)
#define sz(a) (int) (a).size();
using namespace std;
void solve() {
string s; cin >> s;
map<char, int> M;
for (auto c : s) {
M[c]++;
}
if (M.size() <= 2) {
cout << "NO" << '\n';
return;
}
cout << "YES" << '\n';
for (auto [c, cc] : M) {
cout << c;
}
for (auto [c, cc] : M) {
for (int i = 1; i < cc; i++) {
cout << c;
}
}
cout << '\n';
}
int32_t main(){
cin.tie(0); cout.tie(0)->sync_with_stdio(false);
int t; cin >> t;
while (t--) {
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3544kb
input:
5 a sos abba icpc tenet
output:
NO NO NO YES cipc YES entet
result:
wrong answer Jury found the answer but participant didn't (test case 1)