結果

問題 No.135 とりあえず1次元の問題
ユーザー momen999momen999
提出日時 2017-06-11 15:16:48
言語 Haskell
(9.6.2)
結果
AC  
実行時間 484 ms / 5,000 ms
コード長 300 bytes
コンパイル時間 2,029 ms
コンパイル使用メモリ 167,208 KB
実行使用メモリ 41,880 KB
最終ジャッジ日時 2023-10-24 21:03:53
合計ジャッジ時間 5,292 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 454 ms
40,856 KB
testcase_01 AC 2 ms
5,196 KB
testcase_02 AC 2 ms
5,200 KB
testcase_03 AC 2 ms
5,200 KB
testcase_04 AC 2 ms
5,748 KB
testcase_05 AC 3 ms
5,752 KB
testcase_06 AC 3 ms
5,748 KB
testcase_07 AC 3 ms
5,748 KB
testcase_08 AC 3 ms
5,748 KB
testcase_09 AC 3 ms
5,748 KB
testcase_10 AC 3 ms
5,752 KB
testcase_11 AC 2 ms
5,748 KB
testcase_12 AC 4 ms
7,500 KB
testcase_13 AC 3 ms
5,980 KB
testcase_14 AC 7 ms
9,344 KB
testcase_15 AC 4 ms
7,516 KB
testcase_16 AC 7 ms
9,356 KB
testcase_17 AC 7 ms
9,348 KB
testcase_18 AC 3 ms
6,176 KB
testcase_19 AC 7 ms
9,332 KB
testcase_20 AC 6 ms
9,220 KB
testcase_21 AC 284 ms
40,152 KB
testcase_22 AC 484 ms
41,880 KB
evil01.txt AC 373 ms
40,848 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

import Data.List

rInt :: String -> Int
rInt = read

solve n xs
    | n == 1 || length xs == 1  = 0
    | otherwise                 = minimum $ zipWith (-) (tail xs) (init xs)

main = do
    n <- rInt <$> getLine
    xs <- map head . group . sort . map rInt . words <$> getLine
    print $ solve n xs
0