Submission #1520529


Source Code Expand

main = putStrLn =<< p . all s . zip <$> getLine <*> getLine

s (x, y)
  | x == y = True
  | x == '@' && y `elem` "atcoder" = True
  | y == '@' && x `elem` "atcoder" = True
  | otherwise = False

p True = "You can win"
p False = "You will lose"

Submission Info

Submission Time
Task B - AtCoderトランプ
User Gash788
Language Haskell (GHC 7.10.3)
Score 0
Code Size 252 Byte
Status CE

Compile Error

Main.hs:1:21:
    Couldn't match type ‘[Char]’ with ‘String -> String’
    Expected type: Bool -> String -> String
      Actual type: Bool -> [Char]
    In the first argument of ‘(.)’, namely ‘p’
    In the first argument of ‘(<$>)’, namely ‘p . all s . zip’

Main.hs:1:33:
    Couldn't match type ‘[(Char, b0)]’ with ‘(Char, Char)’
    Expected type: [Char] -> [b0] -> (Char, Char)
      Actual type: [Char] -> [b0] -> [(Char, b0)]
    In the second argument of ‘(.)’, namely ‘zip’
    In the second argument of ‘(.)’, namely ‘all s . zip’