Code Submission Evaluation System Login

HIIT Open 2017

Start:2017-05-27 11:00:00
End:2017-05-27 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2017 - Results
History
2017-05-27 11:12:12
Task:Dynamic duo
Sender:Nää jäbät
Submission time:2017-05-27 11:12:12
Language:C++
Status:READY
Result:ACCEPTED

Test results

testverdicttime (s)
#1ACCEPTED0.05 / 1.00details
#2ACCEPTED0.06 / 1.00details
#3ACCEPTED0.05 / 1.00details
#4ACCEPTED0.03 / 1.00details
#5ACCEPTED0.06 / 1.00details
#6ACCEPTED0.07 / 1.00details
#7ACCEPTED0.06 / 1.00details
#8ACCEPTED0.03 / 1.00details
#9ACCEPTED0.07 / 1.00details
#10ACCEPTED0.06 / 1.00details
#11ACCEPTED0.04 / 1.00details
#12ACCEPTED0.05 / 1.00details
#13ACCEPTED0.07 / 1.00details
#14ACCEPTED0.07 / 1.00details
#15ACCEPTED0.05 / 1.00details
#16ACCEPTED0.06 / 1.00details
#17ACCEPTED0.05 / 1.00details
#18ACCEPTED0.05 / 1.00details
#19ACCEPTED0.05 / 1.00details
#20ACCEPTED0.02 / 1.00details
#21ACCEPTED0.05 / 1.00details
#22ACCEPTED0.06 / 1.00details
#23ACCEPTED0.04 / 1.00details
#24ACCEPTED0.04 / 1.00details
#25ACCEPTED0.05 / 1.00details
#26ACCEPTED0.05 / 1.00details
#27ACCEPTED0.04 / 1.00details
#28ACCEPTED0.05 / 1.00details
#29ACCEPTED0.04 / 1.00details
#30ACCEPTED0.06 / 1.00details
#31ACCEPTED0.04 / 1.00details
#32ACCEPTED0.07 / 1.00details
#33ACCEPTED0.04 / 1.00details
#34ACCEPTED0.06 / 1.00details
#35ACCEPTED0.06 / 1.00details
#36ACCEPTED0.04 / 1.00details
#37ACCEPTED0.05 / 1.00details
#38ACCEPTED0.07 / 1.00details
#39ACCEPTED0.03 / 1.00details
#40ACCEPTED0.05 / 1.00details
#41ACCEPTED0.06 / 1.00details
#42ACCEPTED0.05 / 1.00details
#43ACCEPTED0.04 / 1.00details
#44ACCEPTED0.09 / 1.00details
#45ACCEPTED0.11 / 1.00details
#46ACCEPTED0.10 / 1.00details
#47ACCEPTED0.11 / 1.00details

Compiler report

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

Code

#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main () {
    string s;
    cin>>s;
    sort(s.begin(), s.end());
    if (s.length() % 2) {
        cout<<-1<<endl;
    } else {
        string a = s.substr(0, s.length() / 2);
        string b = s.substr(s.length() / 2);
        for (int i = 0; i < a.length(); i++) {
            if (a[i] == b[i]) {
                cout<<-1<<endl;
                return 0;
            }
        }
        cout<<a<<endl<<b<<endl;
    }
}

Test details

Test 1

Verdict: ACCEPTED

input
BA
view   save

correct output
A
B
view   save

user output
A
B
view   save

Test 2

Verdict: ACCEPTED

input
AA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 3

Verdict: ACCEPTED

input
CAAB
view   save

correct output
AA
BC
view   save

user output
AA
BC
view   save

Test 4

Verdict: ACCEPTED

input
BABA
view   save

correct output
AA
BB
view   save

user output
AA
BB
view   save

Test 5

Verdict: ACCEPTED

input
BBCCAA
view   save

correct output
AAB
BCC
view   save

user output
AAB
BCC
view   save

Test 6

Verdict: ACCEPTED

input
AAAB
view   save

correct output
-1
view   save

user output
-1
view   save

Test 7

Verdict: ACCEPTED

input
BAABAC
view   save

correct output
AAA
BBC
view   save

user output
AAA
BBC
view   save

Test 8

Verdict: ACCEPTED

input
ABABAB
view   save

correct output
AAA
BBB
view   save

user output
AAA
BBB
view   save

Test 9

Verdict: ACCEPTED

input
BCBACAAB
view   save

correct output
AAAB
BBCC
view   save

user output
AAAB
BBCC
view   save

Test 10

Verdict: ACCEPTED

input
AAAA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 11

Verdict: ACCEPTED

input
AABCAA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 12

Verdict: ACCEPTED

input
AAABBA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 13

Verdict: ACCEPTED

input
BBAACCAA
view   save

correct output
AAAA
BBCC
view   save

user output
AAAA
BBCC
view   save

Test 14

Verdict: ACCEPTED

input
ABAACBBA
view   save

correct output
AAAA
BBBC
view   save

user output
AAAA
BBBC
view   save

Test 15

Verdict: ACCEPTED

input
BBCCABAAAC
view   save

correct output
AAAAB
BBCCC
view   save

user output
AAAAB
BBCCC
view   save

Test 16

Verdict: ACCEPTED

input
BAAABABB
view   save

correct output
AAAA
BBBB
view   save

user output
AAAA
BBBB
view   save

Test 17

Verdict: ACCEPTED

input
CBBACABBAA
view   save

correct output
AAAAB
BBBCC
view   save

user output
AAAAB
BBBCC
view   save

Test 18

Verdict: ACCEPTED

input
BCACBAACBABC
view   save

correct output
AAAABB
BBCCCC
view   save

user output
AAAABB
BBCCCC
view   save

Test 19

Verdict: ACCEPTED

input
AAAABA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 20

Verdict: ACCEPTED

input
BAAAACBA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 21

Verdict: ACCEPTED

input
BBAAAABA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 22

Verdict: ACCEPTED

input
BAACCBABAA
view   save

correct output
AAAAA
BBBCC
view   save

user output
AAAAA
BBBCC
view   save

Test 23

Verdict: ACCEPTED

input
BABACAABAB
view   save

correct output
AAAAA
BBBBC
view   save

user output
AAAAA
BBBBC
view   save

Test 24

Verdict: ACCEPTED

input
CCAABBABCBAA
view   save

correct output
AAAAAB
BBBCCC
view   save

user output
AAAAAB
BBBCCC
view   save

Test 25

Verdict: ACCEPTED

input
AABBAAABBB
view   save

correct output
AAAAA
BBBBB
view   save

user output
AAAAA
BBBBB
view   save

Test 26

Verdict: ACCEPTED

input
BABAACACBBAB
view   save

correct output
AAAAAB
BBBBCC
view   save

user output
AAAAAB
BBBBCC
view   save

Test 27

Verdict: ACCEPTED

input
AABBBCCABCABAC
view   save

correct output
AAAAABB
BBBCCCC
view   save

user output
AAAAABB
BBBCCCC
view   save

Test 28

Verdict: ACCEPTED

input
AAAAAA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 29

Verdict: ACCEPTED

input
AABACAAA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 30

Verdict: ACCEPTED

input
BAAABAAA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 31

Verdict: ACCEPTED

input
ABAABAACAC
view   save

correct output
-1
view   save

user output
-1
view   save

Test 32

Verdict: ACCEPTED

input
AAAABACBBA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 33

Verdict: ACCEPTED

input
BABCCBAACAAA
view   save

correct output
AAAAAA
BBBCCC
view   save

user output
AAAAAA
BBBCCC
view   save

Test 34

Verdict: ACCEPTED

input
BBBAAAABAA
view   save

correct output
-1
view   save

user output
-1
view   save

Test 35

Verdict: ACCEPTED

input
ABBABBAAACCA
view   save

correct output
AAAAAA
BBBBCC
view   save

user output
AAAAAA
BBBBCC
view   save

Test 36

Verdict: ACCEPTED

input
BCACABBACACABA
view   save

correct output
AAAAAAB
BBBCCCC
view   save

user output
AAAAAAB
BBBCCCC
view   save

Test 37

Verdict: ACCEPTED

input
BAABCBAAAABB
view   save

correct output
AAAAAA
BBBBBC
view   save

user output
AAAAAA
BBBBBC
view   save

Test 38

Verdict: ACCEPTED

input
ABBAACCABBCABA
view   save

correct output
AAAAAAB
BBBBCCC
view   save

user output
AAAAAAB
BBBBCCC
view   save

Test 39

Verdict: ACCEPTED

input
ABCACCBABBAACABC
view   save

correct output
AAAAAABB
BBBCCCCC
view   save

user output
AAAAAABB
BBBCCCCC
view   save

Test 40

Verdict: ACCEPTED

input
ABBBAAABBABA
view   save

correct output
AAAAAA
BBBBBB
view   save

user output
AAAAAA
BBBBBB
view   save

Test 41

Verdict: ACCEPTED

input
AAACAABBCABBBB
view   save

correct output
AAAAAAB
BBBBBCC
view   save

user output
AAAAAAB
BBBBBCC
view   save

Test 42

Verdict: ACCEPTED

input
BCBBBCAABABCCAAA
view   save

correct output
AAAAAABB
BBBBCCCC
view   save

user output
AAAAAABB
BBBBCCCC
view   save

Test 43

Verdict: ACCEPTED

input
BBCBAABACCCBAACACB
view   save

correct output
AAAAAABBB
BBBCCCCCC
view   save

user output
AAAAAABBB
BBBCCCCCC
view   save

Test 44

Verdict: ACCEPTED

input
BBABBABABAABAAABBAAABBBBBBAABB...
view   save

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

Test 45

Verdict: ACCEPTED

input
AAAABABABBBBABAABBBABBBBBABBAB...
view   save

correct output
-1
view   save

user output
-1
view   save

Test 46

Verdict: ACCEPTED

input
ABBBAABAABAAABBAAAAABBBABAAAAB...
view   save

correct output
-1
view   save

user output
-1
view   save

Test 47

Verdict: ACCEPTED

input
XOQPQRNTLADFTEQSZYBMIRXWHSQDCM...
view   save

correct output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save

user output
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
view   save