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 13:15:54
2017-05-27 13:03:09
Task:Dynamic duo
Sender:IOG
Submission time:2017-05-27 13:15:54
Language:C++
Status:READY
Result:ACCEPTED

Test results

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

Code

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
 cin.sync_with_stdio(0);
 cin.tie(0);
 string s;
 unordered_map<char, int> map;
 cin >> s;
 int len = s.size();
 
 for (unsigned int i = 0; i < s.size(); ++i)
 {
     if (map[s[i]] < 1)
        map[s[i]] = 1;
     else
         map[s[i]] += 1;
 }
 
 for (auto x : map)
 {
     int count = x.second;
     //cout << count << "\n";
     
     if (count > len/2) {
         cout << "-1" << endl;
         return 0;
     }
 }
 
 string res;
 
 for (auto x : map)
 {
        int occur = x.second;
        for (int i = 0; i < occur; ++i)
        {
            res += x.first;
        }
 }
 
 
 /*string a(res, res + len/2);
 string b(res + len/2, res.end());
 cout << a << endl;
 cout << b << endl;*/
 
 for (int i = 0; i < len/2; ++i)
 {
     cout << res[i];
 }
 
 
 cout << "\n";
 
 for (int i = (len/2); i < len; ++i)
 {
     cout << res[i];
 }
     cout << 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
BA
AC
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
AAC
CBB
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
CAA
ABB
view   save

Test 8

Verdict: ACCEPTED

input
ABABAB
view   save

correct output
AAA
BBB
view   save

user output
BBB
AAA
view   save

Test 9

Verdict: ACCEPTED

input
BCBACAAB
view   save

correct output
AAAB
BBCC
view   save

user output
AAAC
CBBB
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
CCAA
AABB
view   save

Test 14

Verdict: ACCEPTED

input
ABAACBBA
view   save

correct output
AAAA
BBBC
view   save

user output
CBBB
AAAA
view   save

Test 15

Verdict: ACCEPTED

input
BBCCABAAAC
view   save

correct output
AAAAB
BBCCC
view   save

user output
AAAAC
CCBBB
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
AAAACC
CCBBBB
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
CCAAA
AABBB
view   save

Test 23

Verdict: ACCEPTED

input
BABACAABAB
view   save

correct output
AAAAA
BBBBC
view   save

user output
CAAAA
ABBBB
view   save

Test 24

Verdict: ACCEPTED

input
CCAABBABCBAA
view   save

correct output
AAAAAB
BBBCCC
view   save

user output
BBBBAA
AAACCC
view   save

Test 25

Verdict: ACCEPTED

input
AABBAAABBB
view   save

correct output
AAAAA
BBBBB
view   save

user output
BBBBB
AAAAA
view   save

Test 26

Verdict: ACCEPTED

input
BABAACACBBAB
view   save

correct output
AAAAAB
BBBBCC
view   save

user output
CCAAAA
ABBBBB
view   save

Test 27

Verdict: ACCEPTED

input
AABBBCCABCABAC
view   save

correct output
AAAAABB
BBBCCCC
view   save

user output
CCCCBBB
BBAAAAA
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
CCCAAA
AAABBB
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
CCBBBB
AAAAAA
view   save

Test 36

Verdict: ACCEPTED

input
BCACABBACACABA
view   save

correct output
AAAAAAB
BBBCCCC
view   save

user output
AAAAAAC
CCCBBBB
view   save

Test 37

Verdict: ACCEPTED

input
BAABCBAAAABB
view   save

correct output
AAAAAA
BBBBBC
view   save

user output
CAAAAA
ABBBBB
view   save

Test 38

Verdict: ACCEPTED

input
ABBAACCABBCABA
view   save

correct output
AAAAAAB
BBBBCCC
view   save

user output
CCCBBBB
BAAAAAA
view   save

Test 39

Verdict: ACCEPTED

input
ABCACCBABBAACABC
view   save

correct output
AAAAAABB
BBBCCCCC
view   save

user output
CCCCCBBB
BBAAAAAA
view   save

Test 40

Verdict: ACCEPTED

input
ABBBAAABBABA
view   save

correct output
AAAAAA
BBBBBB
view   save

user output
BBBBBB
AAAAAA
view   save

Test 41

Verdict: ACCEPTED

input
AAACAABBCABBBB
view   save

correct output
AAAAAAB
BBBBBCC
view   save

user output
BBBBBBC
CAAAAAA
view   save

Test 42

Verdict: ACCEPTED

input
BCBBBCAABABCCAAA
view   save

correct output
AAAAAABB
BBBBCCCC
view   save

user output
AAAAAACC
CCBBBBBB
view   save

Test 43

Verdict: ACCEPTED

input
BBCBAABACCCBAACACB
view   save

correct output
AAAAAABBB
BBBCCCCCC
view   save

user output
AAAAAACCC
CCCBBBBBB
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
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUU...
view   save