結果

問題 No.33 アメーバがたくさん
ユーザー anonyanony
提出日時 2014-10-03 00:40:45
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 454 bytes
コンパイル時間 1,499 ms
コンパイル使用メモリ 164,864 KB
実行使用メモリ 6,064 KB
最終ジャッジ日時 2023-10-24 17:39:47
合計ジャッジ時間 8,442 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,128 KB
testcase_01 AC 2 ms
5,132 KB
testcase_02 AC 2 ms
5,128 KB
testcase_03 AC 2 ms
5,132 KB
testcase_04 AC 2 ms
5,148 KB
testcase_05 AC 2 ms
5,164 KB
testcase_06 AC 2 ms
5,684 KB
testcase_07 AC 3 ms
6,064 KB
testcase_08 TLE -
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 :: Int -> Int -> [Int] -> [Int]
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