CSES - Putka Open 2020 – 3/5 - Results
Submission details
Task:ABC-poisto
Sender:hltk
Submission time:2020-10-19 11:32:05 +0300
Language:Ruby
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.07 s1, 2details
#20.07 s2details

Code

gets.to_i.times do
  s = gets
  m = s.chars.uniq.map { |c| s.count c }.max
  n = s.length
  puts m*2 <= n ? n-n%2 : (n-m)*2
end

Test details

Test 1

Group: 1, 2

Verdict:

input
100
CABC
BABCCBCA
CBBCBBAC
ACAA
...

correct output
4
8
8
2
2
...

user output
4
8
8
4
2
...
Truncated

Test 2

Group: 2

Verdict:

input
100
CCAAACBCBBCCACBBBCCACCCBABBCAB...

correct output
48
4
4
96
70
...

user output
50
4
6
98
72
...
Truncated