結果

問題 No.33 アメーバがたくさん
ユーザー anonyanony
提出日時 2014-10-03 00:23:14
言語 Haskell
(9.8.2)
結果
MLE  
実行時間 -
コード長 363 bytes
コンパイル時間 4,698 ms
コンパイル使用メモリ 165,776 KB
実行使用メモリ 814,180 KB
最終ジャッジ日時 2023-10-24 17:38:33
合計ジャッジ時間 7,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,124 KB
testcase_01 AC 2 ms
5,136 KB
testcase_02 AC 2 ms
5,124 KB
testcase_03 AC 2 ms
5,200 KB
testcase_04 AC 2 ms
5,220 KB
testcase_05 AC 3 ms
5,252 KB
testcase_06 AC 5 ms
8,328 KB
testcase_07 AC 7 ms
9,332 KB
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

module Main where


eval :: Int -> Int -> [Int] -> [Int]
eval 0 _ = id
eval t d = eval (t - 1) d . filt . (>>= \x -> [x+d, x, x-d]) where
    filt [] = []
    filt (x:xs) = x : filt (filter (/= x) xs)

main :: IO ()
main = do
        [_, d, t] <- fmap (map read . words) getLine
        xs <- fmap (map read . words) getLine
        print $ length $ eval t d xs
0