CSES - HIIT Open 2017 - Results
Submission details
Task:Dynamic duo
Sender:Ace of Spades
Submission time:2017-05-27 11:38:04 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.07 sdetails
#2ACCEPTED0.04 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.07 sdetails
#50.07 sdetails
#6ACCEPTED0.05 sdetails
#7ACCEPTED0.06 sdetails
#8ACCEPTED0.05 sdetails
#90.05 sdetails
#10ACCEPTED0.05 sdetails
#11ACCEPTED0.05 sdetails
#12ACCEPTED0.06 sdetails
#13ACCEPTED0.05 sdetails
#14ACCEPTED0.04 sdetails
#150.04 sdetails
#16ACCEPTED0.05 sdetails
#170.04 sdetails
#180.03 sdetails
#19ACCEPTED0.04 sdetails
#20ACCEPTED0.03 sdetails
#21ACCEPTED0.06 sdetails
#22ACCEPTED0.06 sdetails
#23ACCEPTED0.05 sdetails
#240.06 sdetails
#25ACCEPTED0.06 sdetails
#260.04 sdetails
#270.05 sdetails
#28ACCEPTED0.05 sdetails
#29ACCEPTED0.03 sdetails
#30ACCEPTED0.06 sdetails
#31ACCEPTED0.04 sdetails
#32ACCEPTED0.03 sdetails
#33ACCEPTED0.05 sdetails
#34ACCEPTED0.05 sdetails
#35ACCEPTED0.03 sdetails
#360.06 sdetails
#37ACCEPTED0.04 sdetails
#380.05 sdetails
#390.06 sdetails
#40ACCEPTED0.06 sdetails
#410.04 sdetails
#420.05 sdetails
#430.05 sdetails
#44ACCEPTED0.11 sdetails
#45ACCEPTED0.14 sdetails
#46ACCEPTED0.11 sdetails
#470.13 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:13:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int64_t i = 0; i < s.size()/2; ++i) {
                                      ^
input/code.cpp:17:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int64_t i = 0; i < s.size()/2; ++i) {
                                      ^

Code

#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(void) {
    string s;
    cin >> s;
    sort(s.begin(), s.end());

    string s1, s2;
    for (int64_t i = 0; i < s.size()/2; ++i) {
	s1+=s[i];
	s2+=s[s.size()-i-1];
    }
    for (int64_t i = 0; i < s.size()/2; ++i) {
	if (s1[i] == s2[i]) {
	    cout << "-1\n";
	    return 0;
	}
    }
    cout << s1 << "\n" << s2 << "\n";
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
BA

correct output
A
B

user output
A
B

Test 2

Verdict: ACCEPTED

input
AA

correct output
-1

user output
-1

Test 3

Verdict: ACCEPTED

input
CAAB

correct output
AA
BC

user output
AA
CB

Test 4

Verdict: ACCEPTED

input
BABA

correct output
AA
BB

user output
AA
BB

Test 5

Verdict:

input
BBCCAA

correct output
AAB
BCC

user output
-1

Test 6

Verdict: ACCEPTED

input
AAAB

correct output
-1

user output
-1

Test 7

Verdict: ACCEPTED

input
BAABAC

correct output
AAA
BBC

user output
AAA
CBB

Test 8

Verdict: ACCEPTED

input
ABABAB

correct output
AAA
BBB

user output
AAA
BBB

Test 9

Verdict:

input
BCBACAAB

correct output
AAAB
BBCC

user output
-1

Test 10

Verdict: ACCEPTED

input
AAAA

correct output
-1

user output
-1

Test 11

Verdict: ACCEPTED

input
AABCAA

correct output
-1

user output
-1

Test 12

Verdict: ACCEPTED

input
AAABBA

correct output
-1

user output
-1

Test 13

Verdict: ACCEPTED

input
BBAACCAA

correct output
AAAA
BBCC

user output
AAAA
CCBB

Test 14

Verdict: ACCEPTED

input
ABAACBBA

correct output
AAAA
BBBC

user output
AAAA
CBBB

Test 15

Verdict:

input
BBCCABAAAC

correct output
AAAAB
BBCCC

user output
-1

Test 16

Verdict: ACCEPTED

input
BAAABABB

correct output
AAAA
BBBB

user output
AAAA
BBBB

Test 17

Verdict:

input
CBBACABBAA

correct output
AAAAB
BBBCC

user output
-1

Test 18

Verdict:

input
BCACBAACBABC

correct output
AAAABB
BBCCCC

user output
-1

Test 19

Verdict: ACCEPTED

input
AAAABA

correct output
-1

user output
-1

Test 20

Verdict: ACCEPTED

input
BAAAACBA

correct output
-1

user output
-1

Test 21

Verdict: ACCEPTED

input
BBAAAABA

correct output
-1

user output
-1

Test 22

Verdict: ACCEPTED

input
BAACCBABAA

correct output
AAAAA
BBBCC

user output
AAAAA
CCBBB

Test 23

Verdict: ACCEPTED

input
BABACAABAB

correct output
AAAAA
BBBBC

user output
AAAAA
CBBBB

Test 24

Verdict:

input
CCAABBABCBAA

correct output
AAAAAB
BBBCCC

user output
-1

Test 25

Verdict: ACCEPTED

input
AABBAAABBB

correct output
AAAAA
BBBBB

user output
AAAAA
BBBBB

Test 26

Verdict:

input
BABAACACBBAB

correct output
AAAAAB
BBBBCC

user output
-1

Test 27

Verdict:

input
AABBBCCABCABAC

correct output
AAAAABB
BBBCCCC

user output
-1

Test 28

Verdict: ACCEPTED

input
AAAAAA

correct output
-1

user output
-1

Test 29

Verdict: ACCEPTED

input
AABACAAA

correct output
-1

user output
-1

Test 30

Verdict: ACCEPTED

input
BAAABAAA

correct output
-1

user output
-1

Test 31

Verdict: ACCEPTED

input
ABAABAACAC

correct output
-1

user output
-1

Test 32

Verdict: ACCEPTED

input
AAAABACBBA

correct output
-1

user output
-1

Test 33

Verdict: ACCEPTED

input
BABCCBAACAAA

correct output
AAAAAA
BBBCCC

user output
AAAAAA
CCCBBB

Test 34

Verdict: ACCEPTED

input
BBBAAAABAA

correct output
-1

user output
-1

Test 35

Verdict: ACCEPTED

input
ABBABBAAACCA

correct output
AAAAAA
BBBBCC

user output
AAAAAA
CCBBBB

Test 36

Verdict:

input
BCACABBACACABA

correct output
AAAAAAB
BBBCCCC

user output
-1

Test 37

Verdict: ACCEPTED

input
BAABCBAAAABB

correct output
AAAAAA
BBBBBC

user output
AAAAAA
CBBBBB

Test 38

Verdict:

input
ABBAACCABBCABA

correct output
AAAAAAB
BBBBCCC

user output
-1

Test 39

Verdict:

input
ABCACCBABBAACABC

correct output
AAAAAABB
BBBCCCCC

user output
-1

Test 40

Verdict: ACCEPTED

input
ABBBAAABBABA

correct output
AAAAAA
BBBBBB

user output
AAAAAA
BBBBBB

Test 41

Verdict:

input
AAACAABBCABBBB

correct output
AAAAAAB
BBBBBCC

user output
-1

Test 42

Verdict:

input
BCBBBCAABABCCAAA

correct output
AAAAAABB
BBBBCCCC

user output
-1

Test 43

Verdict:

input
BBCBAABACCCBAACACB

correct output
AAAAAABBB
BBBCCCCCC

user output
-1

Test 44

Verdict: ACCEPTED

input
BBABBABABAABAAABBAAABBBBBBAABB...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

Test 45

Verdict: ACCEPTED

input
AAAABABABBBBABAABBBABBBBBABBAB...

correct output
-1

user output
-1

Test 46

Verdict: ACCEPTED

input
ABBBAABAABAAABBAAAAABBBABAAAAB...

correct output
-1

user output
-1

Test 47

Verdict:

input
XOQPQRNTLADFTEQSZYBMIRXWHSQDCM...

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

user output
-1