結果

問題 No.33 アメーバがたくさん
ユーザー anonyanony
提出日時 2014-10-03 00:47:05
言語 Haskell
(9.8.2)
結果
MLE  
実行時間 -
コード長 470 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 163,744 KB
実行使用メモリ 816,404 KB
最終ジャッジ日時 2023-10-24 17:39:16
合計ジャッジ時間 6,315 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,212 KB
testcase_01 AC 2 ms
5,224 KB
testcase_02 AC 2 ms
5,212 KB
testcase_03 AC 2 ms
5,224 KB
testcase_04 AC 2 ms
5,240 KB
testcase_05 AC 2 ms
5,256 KB
testcase_06 AC 3 ms
5,768 KB
testcase_07 AC 3 ms
6,148 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

import Data.List

eval :: Integer -> Integer -> [Integer] -> [Integer]
eval 0 _ = id
eval t d = eval (t - 1) d . f . (>>= \x -> [x+d, x, x-d]) where
    f = g . sort
    g [] = []
    g (x:xs) = x : g (filt (/= x) xs)
    filt _ [] = []
    filt p (y:ys) = if p y then y:ys else filt p ys

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