CSES - Datatähti 2018 alku - Results
Submission details
Task:Merkkijono
Sender:funkar
Submission time:2017-10-09 17:32:41 +0300
Language:Haskell
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.13 sdetails
#2ACCEPTED0.07 sdetails
#3--details
#40.07 sdetails
#5--details
#6--details
#7--details
#8--details
#9--details
#10--details

Compiler report

input/code.hs:16:1: Warning:
    Top-level binding with no type signature: main :: IO ()

Code

import Data.List


j :: String -> String
matches :: String -> Bool
dropFirst :: String -> String
matches xs = length xs /= length (nub xs)
j (xs)
  | not (matches xs) = xs
  | otherwise = j (dropFirst xs)
dropFirst x
  | length (head g) /= 1 = concat (tail g)
  | otherwise = head g ++ dropFirst (concat (tail g))
  where g = group x

main = do
  line <- getLine
  putStrLn (j line)

Test details

Test 1

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
ABABABABABABABABABABABABABABAB...

user output
(empty)

Error:
code: Prelude.head: empty list

Test 2

Verdict: ACCEPTED

input
AABBAABBAABBAABBAABBAABBAABBAA...

correct output
(empty)

user output
(empty)

Test 3

Verdict:

input
ABABABABABABABABABABABABABABAB...

correct output
(empty)

user output
(empty)

Test 4

Verdict:

input
BBABABBBBBAABBBABABABBBBAAABAB...

correct output
BAB

user output
(empty)

Error:
code: Prelude.head: empty list

Test 5

Verdict:

input
ACDCBBACDBBBACAACBBDBADBAABABA...

correct output
ACDCACDADBADABACACDCADADABABCA...

user output
(empty)

Test 6

Verdict:

input
EETFHIJOGACDHMGVFJCMETMZDEITTR...

correct output
TFHIJOGACDHMGVFJCMETMZDEIROTET...

user output
(empty)

Test 7

Verdict:

input
GOONLAHLYPRFCZKIKSJWAWWYJJPCDB...

correct output
GNLAHLYPRFCZKIKSJWAYPCDNWYMRCE...

user output
(empty)

Test 8

Verdict:

input
PISHWMOTCDDZFRMYMOMYDYYGJZIQHS...

correct output
PISHWMOTCZFRMYMOMYDGJZIQHSVAOK...

user output
(empty)

Test 9

Verdict:

input
QUVVTPXAMWWODFXRONJODPGBTCISGM...

correct output
QUTPXAMODFXRONJODPGBTCISGMVRBW...

user output
(empty)

Test 10

Verdict:

input
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

correct output
POXHAHYEZTLYNFSLABODMRNKDSKROZ...

user output
(empty)