AtCoder Beginner Contest 003

Submission #1520538

Source codeソースコード

main = putStrLn =<< p . and . zipWith s <$> getLine <*> getLine
 
s :: Char -> Char -> Bool
s x y
  | x == y = True
  | x == '@' && y `elem` "atcoder" = True
  | y == '@' && x `elem` "atcoder" = True
  | otherwise = False
 
p :: Bool -> String
p True = "You can win"
p False = "You will lose"

Submission

Task問題 B - AtCoderトランプ
User nameユーザ名 Gash788
Created time投稿日時
Language言語 Haskell (GHC 7.10.3)
Status状態 CE
Score得点 -
Source lengthソースコード長 303 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ


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

Main.hs:1:31:
Couldn't match type ‘[Bool]’ with ‘Bool’
Expected type: [Char] -> [Char] -> Bool
Actual type: [Char] -> [Char] -> [Bool]
In the second argument of ‘(.)’, namely ‘zipWith s’
In the second argument of ‘(.)’, namely ‘and . zipWith s’

Test case