QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#185803 | #2374. Cycle String? | Hanx16Msgr | WA | 5ms | 5508kb | C++14 | 1003b | 2023-09-22 17:00:51 | 2023-09-22 17:00:53 |
Judging History
answer
#include<bits/stdc++.h>
#define For(i, a, b) for (int i = (a); i <= (b); ++i)
#define Rof(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;
using i64 = long long;
constexpr int _N = 1e6 + 5;
string c;
deque<pair<int, int>> q;
int cnt[26];
signed main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> c;
int n = c.length() / 2;
for (char t : c) ++cnt[t - 'a'];
int maxn = 0, p = 0;
For(i, 0, 25) if (cnt[i] > maxn) maxn = cnt[i], p = i;
string ans;
if (maxn > n) {
int tmp = 0;
For(i, 0, 25) if (cnt[i] != maxn) tmp += cnt[i];
if (tmp <= 2) return cout << "NO\n", 0;
vector<int> q;
For(i, 0, 25) if (i != p)
For(j, 1, cnt[i]) q.push_back(i);
tmp = 0;
For(i, 1, maxn) {
++tmp; ans += p + 'a';
if (tmp == n) {
ans += q.back() + 'a';
tmp = 0;
q.pop_back();
}
}
for (int x : q) ans += x + 'a';
} else {
For(i, 0, 25) For(j, 1, cnt[i])
ans += i + 'a';
}
cout << "YES\n" << ans << '\n';
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3812kb
input:
cbbabcacbb
output:
YES aabbbbbccc
result:
ok The contestant and jury found an answer
Test #2:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
aa
output:
NO
result:
ok Solution does not exist
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
afedbc
output:
YES abcdef
result:
ok The contestant and jury found an answer
Test #4:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
cghfbdae
output:
YES abcdefgh
result:
ok The contestant and jury found an answer
Test #5:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
babcacca
output:
YES aaabbccc
result:
ok The contestant and jury found an answer
Test #6:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
hfjeacbdgi
output:
YES abcdefghij
result:
ok The contestant and jury found an answer
Test #7:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
fblcmcafgichjocodacanejmiaghclclmpnjcklkelhijghmgkhicdaafkgiaenjefkmmminihdfmiokjghdnohmddmgae
output:
YES aaaaaaaabcccccccccddddddeeeeefffffggggggghhhhhhhhiiiiiiiijjjjjjkkkkkklllllmmmmmmmmmmnnnnnoooop
result:
ok The contestant and jury found an answer
Test #8:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
babaccacbcacacbcabbcacacbbbbabccbcbaabbbabcbbcacaaccbbbaaacacaccaacabaabaaaabaabbccabcaaacccccabbcbacabccbacabacaccbbabccccabbacccbaacacaccbacababcaccaccacacbaaccbcccaaacaabbacbcbbcccaaaacbbcccccccccaabbcabcbcacbccaababcaaccccaccbcbacaacbaacbbaacbaacbacaaaacaaacbbbaccbabcababaccacacccbcbbcccaaaababa...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb...
result:
ok The contestant and jury found an answer
Test #9:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
ccfaehbdffhadecdgacahfgbbbgcccfhfdbafbadddcgcfdafccdcafhaggeaghchcdegbfcecbhdhefdahddaeadacbachgdcchdcfdbefbbdcadegbefghceehabcaggahfahcgdchdbfhhcdefaadafcgdcfefdhebddhfahehedeefhcbdedafdaggbgggeadecgeefafafedcfgeehbhefhdfgdbebadeefdhhdedbgdfeehfchhfeffdfffghhehfbfegacbehdehcdaadhfhgdbhcaghcccgdcgdd...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #10:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
ifeehacdbg
output:
YES abcdeefghi
result:
ok The contestant and jury found an answer
Test #11:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
gwrffzdydmtyficvthjgseannpwxxkaqyrykfbziqszdirlwkqzsvwohmmcaudpyovcnfddsdvvytpdsal
output:
YES aaaabcccddddddddefffffgghhiiijkkkllmmmnnnoopppqqqrrrssssstttuvvvvvwwwwxxyyyyyyzzzz
result:
ok The contestant and jury found an answer
Test #12:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
gbmfhaeabeleiagcllhiiifmchighalckkghajaihiagmclibehjbaegdajebjhfbidahblcbemcdmmjbcdbhbdfldljmffgcbkdmacmjccmbjjmjccbaiiaffegbblbhehfaljdedhmkhldefdhgfgeagdglijediihclkcklcaefdmedkffabfcaliheaiaiagaegejmmddkkedbigkmdammkhemllbckieefclhglhgeabgfffkijjemekmkjggdjehmidbjjjhljdmjkeijaigiffkhfehkekglcaeje...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...
result:
ok The contestant and jury found an answer
Test #13:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
pangkaeejgcohrfranglmibbnmldpriqndrjbhqcfdibgjlhedbghhiqcbhafrcpchhdjfakqnikdgpqcghcknnqrgpjjdhnjhbjhljdoorojmfbrrlljmimqfdrojmfldpdmclafhkmidqhalnrikcgmqgcnihorfnbojmfrrflqkmgbpqbieeffjbphrekocrmjjjopojmqahpeqpfkpmhpriarlmgoqmmjhdbpoaaiggpppgnhlfckcndmmklafdpnkgrkrgfhcgfhogghcmiobhgpjeenffmgbjjbdca...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #14:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
output:
NO
result:
ok Solution does not exist
Test #15:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
NO
result:
ok Solution does not exist
Test #16:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
NO
result:
ok Solution does not exist
Test #17:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
baabba
output:
YES aaabbb
result:
ok The contestant and jury found an answer
Test #18:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
aaabbaabbbabbaaabbbbbbbbabaaaaabbababaaaabaaaabbbaababbb
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbb
result:
ok The contestant and jury found an answer
Test #19:
score: 0
Accepted
time: 1ms
memory: 3704kb
input:
baabaaabaabaabbaaaababbababbababaaabbaabaaabaaaabbbaaabaabaaaabbbbaabbabbabbabaaababbabaabbabbbabaabbabbbbbbbbaaabbabbaaaaaaabaaaaaababaaabbaabbaabaaabaaabbabbbabaaaabbbabaaaaabaababaaabababaababababbbaabababbaaabbbbbaabaabababbaaaabaabbbaababbaabbbaababbbbaaaababbabababbbabbbbabaabaabaabbbbbabbabbb...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #20:
score: 0
Accepted
time: 2ms
memory: 3996kb
input:
bbbaaabbbaaabbaabababbababbbaaaababbbaaabaababaabbaaababbbabbbababbbbbabbabbabaaabbababababbaabaabbbabbababbaabbabaabbaabbbabaaaaabbabbbbbababaaaaabbbbbabaaabbaabaaabbababbabaaaaaaaaabbaabbaaababbabbaababbabbabbabbbaaaaaabbababbabbbbbaaaaabbbabbbbaaaaaaababbabaaaabaabbbbaaaaaababaabaababbbbbbabaabaa...
output:
YES bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
result:
ok The contestant and jury found an answer
Test #21:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
bbacaabbcaaacccbabcaacab
output:
YES aaaaaaaaaabbbbbbbccccccc
result:
ok The contestant and jury found an answer
Test #22:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
bbabcaccabacccbbaababbbbbcbabbcacbcbacacacbbbcbbbcacccacaccbcaacbbbacaacaccbaabacaaabaaacabcaacacbbcbabaccacacccbacabbbbccacbaabcabacbbacbaabaaaabcccbaacabbccbaccbccacbcaccbcbacbbacaccaaaaabccabacabcbbacccabaccbaababbccbbbbababbbaaacbabaaaabbaaaaababcabbaaaaaaccacccbbaacbabbbcacbcabbbbacccbbbcaaabcc...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #23:
score: 0
Accepted
time: 5ms
memory: 5508kb
input:
cccccabccacabbabcaabcacabbbbcbbbabaccabcbbbcabababcabcbbaccbcbaaababccbaccaaacbbbcbccbcbbbabbbaabcabcaaaacbcccababbaccabacccabbaaabbcaccaacbcbccbbbacbbcccacbabbbcabacabcabcabcabbacbcaacaabccabbabbcaacaccbabccacaccababbaababaabbcabbbaaabaccbbcbcaaabccbaccbcbaabcabcbbbbbbbbabcbccbccaabaacaacbabbbcacac...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #24:
score: 0
Accepted
time: 2ms
memory: 4192kb
input:
eqkhnrkaytrgbwpmopavlpkakdveoyvwudwytxmgtwossflwskfiyqjstgykwbimitkefitjhyvgyswancnfrbuoqpqjjirfxarxybouwidptteqlckyrfnjucpjvpvnrykqykvxlcuyvxlyvvkqlsucsrdmscnswmefrkbmkdegvmeecmeutfquguosbgwdayyodcrqowjetqrjjydmnotedicfpmyoocbkqbdiiusinmvervloqrlwdkyhnvgakqheaejqfjfdchgohhjasgtkcpoyyfrflokjhptdwqjt...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #25:
score: 0
Accepted
time: 0ms
memory: 5228kb
input:
jiicbbaheebcidjgcaihedbichhaijgiahcijafdeegajgigeaaicifecggjiddgedbfcfcecedadgjeaihhffhbchecchdjgabgigaebfbdhdiiadgiaeaiiahhjiighcjfefgdgjibcifjgiiaafadeieaafjceebhhjbedeibhaejbeecdadhafifhcihhifdjbhjedhfjhafgbgbfgdeabccieibebicgcaicgcafjdicfbgefebagjdfbiihdcbdbajcgdddjfediaijdccjhefcgiecedfcfchcigh...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #26:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
pebefqcnesiqgkhobernbhgbbenppejlonforlpbqloosfefoiacelqiicgjslbrjlrrslrmmkeaqoensnpacaooblkqocqcqlifkrlrgoqarhnnphrcriphojijdqisdrbshnhiljhifpgppsmrccfppslopampejdssnrsfojsaanqaonlghnarhqdajfprreioepckooofjanipahplsoidnqjmfchhpipbhgqklhfrbaodakhgabodakpjaakhsfnjnpskoleffpsfllnbrgprclnjkhggsjmprasmcc...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #27:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
baabaaabbabbabbbabaaabbababbaaaaaaaababaabbbbaababaababbaabbbabbbbabbbabbabbbabaabbabbbaababaaaabbbaaaaaaaaaababbbabbabbaaaabaabbbbbabbbbbbbbabbbaaabbabbbbbabaabbbaabaabababbbabaababbaabbbbabbbbabaaaaabbbbababababbabbbbaaaabbbbaabbbabbbbbbbabbabbaabbbbbbaaaaabaaaabbbabbbbabbabaabbaaaabaabbbbbbbbbaab...
output:
YES bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
result:
ok The contestant and jury found an answer
Test #28:
score: 0
Accepted
time: 2ms
memory: 5172kb
input:
giiilhifbalmiceefhegdmfbkbhjdimijhfhbllkahekkdkcggadaeakdhmglmfjmibbgkbeeffgdaffbacmdeleldlihafcemfjgjmfjkjmdjgbidmjjcbfjkefkdjlahllkmiiegebmckjfchbgmiecdlcdmibejaekhkamffhciflfiaafbahcklelghleefchladcaacjkbkgambjijgfamgkjegfmbahikmjbcbcaliedgkjicfajmalmheddjfeaeflddcelgjfefddabgfgjmgkfaeeclkjdggdbl...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #29:
score: 0
Accepted
time: 0ms
memory: 4112kb
input:
eehihehiaegegieecagbbaeccicbhajjfagbfaegjafeadidaeefgeddejdgfecbejaijdccjbcggebdjgabhddibgaeidafhdfejgihjegebbdgajaebdgaeehbihiihjfjjacjhjaeidacgbejbjgigeheicbcejahhiibjcchiadigcfdbfgaedjadaefjfagbfagccejfbgaacejcdaihifidjhfaiijgajcfjaifhifbbhcegacdbbedfdigbgibaiiajagfdfcaabbffffiieijahifjhdgahgfige...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #30:
score: 0
Accepted
time: 1ms
memory: 3748kb
input:
abfedgdgafadeeaeadbeabdcdbfbbebdbgdddaeegeecebgcdgbcgefeadefgddbecedbcgacbbffdgefgbdaebfdaafdddcgecaagegdfgdafafcaadggdagdaeedagaegdcfdedcefggcgbedafbbcbdfbegfagcegdfggagdgfeagbbddcfcbbdbbaegdedfdagggbdafebfgacdefeabbdecbeaceeaebgeaaddegfaedbfgggaeecabfacadbcadgcgbcbefcdabbdbbcggafgadffadcaagebadecc...
output:
YES aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
result:
ok The contestant and jury found an answer
Test #31:
score: 0
Accepted
time: 0ms
memory: 5496kb
input:
babbbabbaabbbbaaababaaaaabbaaaabaaaaaabbaaaaababbabbaabbbbaabbababbbbabbbaabaabbaaaaaaabaaaaaaabbabbababbababbabbbbaaaaaaaaabaaaaabbabaabbaabbaabbaaabbbbbbaabaaabbbbaabbabbabaaabbbaaabaabbaaabaaaabbbaabbbaaabaabaaababbaabababbbabaabbaabbbbaaaaababbabbaaabbbabaabbaabbbaaabababbbbbabbbbbbabbbaabbaabba...
output:
YES bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
result:
ok The contestant and jury found an answer
Test #32:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
abcabc
output:
YES aabbcc
result:
ok The contestant and jury found an answer
Test #33:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
bc
output:
YES bc
result:
ok The contestant and jury found an answer
Test #34:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
zbzz
output:
NO
result:
ok Solution does not exist
Test #35:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
zbbz
output:
YES bbzz
result:
ok The contestant and jury found an answer
Test #36:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
aabbbb
output:
NO
result:
ok Solution does not exist
Test #37:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
aaabbbbb
output:
YES bbbbabaa
result:
ok The contestant and jury found an answer
Test #38:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
aaabbb
output:
YES aaabbb
result:
ok The contestant and jury found an answer
Test #39:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
aazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
output:
NO
result:
ok Solution does not exist
Test #40:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
dzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
output:
NO
result:
ok Solution does not exist
Test #41:
score: -100
Wrong Answer
time: 0ms
memory: 3552kb
input:
aaaabc
output:
NO
result:
wrong answer The contestant did not find a solution while jury did it