結果

問題 No.91 赤、緑、青の石
ユーザー momen999momen999
提出日時 2017-05-01 17:29:27
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 7,352 ms
コンパイル使用メモリ 160,652 KB
実行使用メモリ 7,428 KB
最終ジャッジ日時 2023-10-12 02:08:22
合計ジャッジ時間 4,270 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 3 ms
7,196 KB
testcase_07 AC 3 ms
7,248 KB
testcase_08 AC 2 ms
7,152 KB
testcase_09 AC 2 ms
7,260 KB
testcase_10 AC 2 ms
7,200 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 3 ms
7,148 KB
testcase_17 AC 3 ms
7,200 KB
testcase_18 AC 3 ms
7,124 KB
testcase_19 AC 2 ms
7,204 KB
testcase_20 AC 3 ms
7,192 KB
testcase_21 AC 2 ms
7,212 KB
testcase_22 AC 2 ms
7,156 KB
testcase_23 AC 3 ms
7,272 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
7,276 KB
testcase_28 AC 2 ms
7,180 KB
testcase_29 AC 2 ms
7,304 KB
testcase_30 AC 3 ms
7,220 KB
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Data.List

rInt :: String -> Int
rInt = read

allStones x y = x * 2 + y

solve xs
    | all (< 3) xs && elem 0 xs = [0,0,0]
    | elem 0 xs = solve $ sort $ elaseZero xs
    | otherwise = xs
    where
        elaseZero [x,y,z] = [1 , y, (z - 2)]

main = do
    stones <- solve . sort . map rInt . words <$> getLine
    print $ foldr allStones (last stones) (init stones) `div` 5
0