結果

問題 No.785 色食い虫
ユーザー ducktailducktail
提出日時 2019-02-08 22:01:32
言語 Haskell
(9.2.2)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 935 ms
使用メモリ 4,028 KB
最終ジャッジ日時 2023-01-28 15:51:50
合計ジャッジ時間 2,471 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,948 KB
testcase_01 AC 2 ms
3,988 KB
testcase_02 AC 2 ms
3,928 KB
testcase_03 AC 2 ms
3,928 KB
testcase_04 AC 2 ms
3,984 KB
testcase_05 AC 2 ms
3,952 KB
testcase_06 AC 2 ms
3,956 KB
testcase_07 AC 1 ms
3,996 KB
testcase_08 AC 2 ms
3,996 KB
testcase_09 AC 2 ms
3,984 KB
testcase_10 AC 2 ms
3,864 KB
testcase_11 AC 1 ms
3,936 KB
testcase_12 AC 2 ms
3,948 KB
testcase_13 AC 2 ms
3,932 KB
testcase_14 AC 2 ms
3,984 KB
testcase_15 AC 2 ms
3,892 KB
testcase_16 AC 2 ms
3,996 KB
testcase_17 AC 2 ms
3,928 KB
testcase_18 AC 2 ms
3,992 KB
testcase_19 AC 2 ms
4,028 KB
testcase_20 AC 2 ms
3,944 KB
testcase_21 AC 2 ms
3,952 KB
testcase_22 AC 2 ms
3,932 KB
testcase_23 AC 2 ms
3,948 KB
testcase_24 AC 2 ms
3,972 KB
testcase_25 AC 2 ms
3,864 KB
testcase_26 AC 2 ms
3,980 KB
testcase_27 AC 2 ms
3,948 KB
testcase_28 AC 2 ms
3,992 KB
testcase_29 AC 2 ms
3,928 KB
testcase_30 AC 2 ms
3,860 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.2.2/environments/default
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking a.out ...

ソースコード

diff #

import Control.Applicative

main :: IO ()
main = solve <$> getLine <*> getLine <*> getLine >>= print

solve :: String -> String -> String -> Int
solve r g b = f r * f g * f b
  where
    f s
      | s == "NONE" = 256
      | otherwise = let x = subtract 15 . length . filter (==',') $ s in x * x
0