結果

問題 No.135 とりあえず1次元の問題
ユーザー momen999momen999
提出日時 2017-06-11 15:14:52
言語 Haskell
(9.8.2)
結果
RE  
実行時間 -
コード長 268 bytes
コンパイル時間 2,680 ms
コンパイル使用メモリ 167,780 KB
実行使用メモリ 39,812 KB
最終ジャッジ日時 2023-10-24 21:03:42
合計ジャッジ時間 5,957 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 464 ms
39,812 KB
testcase_01 AC 2 ms
5,176 KB
testcase_02 AC 2 ms
5,180 KB
testcase_03 RE -
testcase_04 AC 3 ms
5,732 KB
testcase_05 AC 3 ms
5,732 KB
testcase_06 AC 3 ms
5,732 KB
testcase_07 AC 3 ms
5,728 KB
testcase_08 AC 3 ms
5,728 KB
testcase_09 AC 3 ms
5,728 KB
testcase_10 AC 3 ms
5,732 KB
testcase_11 AC 3 ms
5,728 KB
testcase_12 AC 5 ms
7,480 KB
testcase_13 AC 3 ms
5,960 KB
testcase_14 AC 7 ms
9,324 KB
testcase_15 AC 5 ms
7,496 KB
testcase_16 AC 7 ms
9,336 KB
testcase_17 AC 7 ms
9,328 KB
testcase_18 AC 3 ms
6,156 KB
testcase_19 AC 7 ms
9,312 KB
testcase_20 AC 6 ms
9,204 KB
testcase_21 AC 283 ms
37,120 KB
testcase_22 AC 464 ms
39,812 KB
evil01.txt AC 364 ms
39,812 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    = 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