結果

問題 No.516 赤と青の風船
ユーザー momen999momen999
提出日時 2019-04-06 16:27:32
言語 Haskell
(9.6.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 10,508 ms
コンパイル使用メモリ 153,196 KB
実行使用メモリ 6,748 KB
最終ジャッジ日時 2023-09-06 06:19:01
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,628 KB
testcase_01 AC 2 ms
6,588 KB
testcase_02 AC 2 ms
6,656 KB
testcase_03 AC 3 ms
6,656 KB
testcase_04 AC 2 ms
6,748 KB
testcase_05 AC 3 ms
6,700 KB
testcase_06 AC 2 ms
6,600 KB
testcase_07 AC 2 ms
6,580 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Monad (replicateM)
import Data.Bool

main = replicateM 3 getLine >>= putStrLn . rb . foldr f 0  where
    f s y = bool (-1) 1 (s == "RED") + y
    rb = bool "BLUE" "RED" . (> 0)
0