結果

問題 No.135 とりあえず1次元の問題
ユーザー はむ吉🐹はむ吉🐹
提出日時 2015-10-21 21:31:11
言語 Haskell
(9.8.2)
結果
AC  
実行時間 373 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 2,648 ms
コンパイル使用メモリ 165,552 KB
実行使用メモリ 26,388 KB
最終ジャッジ日時 2023-09-01 21:43:57
合計ジャッジ時間 5,670 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 373 ms
26,388 KB
testcase_01 AC 3 ms
7,640 KB
testcase_02 AC 2 ms
7,532 KB
testcase_03 AC 3 ms
7,480 KB
testcase_04 AC 3 ms
8,108 KB
testcase_05 AC 3 ms
8,112 KB
testcase_06 AC 3 ms
8,104 KB
testcase_07 AC 3 ms
8,108 KB
testcase_08 AC 3 ms
8,224 KB
testcase_09 AC 3 ms
8,228 KB
testcase_10 AC 3 ms
8,188 KB
testcase_11 AC 3 ms
8,108 KB
testcase_12 AC 5 ms
9,864 KB
testcase_13 AC 3 ms
8,304 KB
testcase_14 AC 7 ms
11,728 KB
testcase_15 AC 5 ms
9,864 KB
testcase_16 AC 7 ms
11,812 KB
testcase_17 AC 7 ms
11,756 KB
testcase_18 AC 3 ms
8,460 KB
testcase_19 AC 7 ms
11,776 KB
testcase_20 AC 6 ms
11,484 KB
testcase_21 AC 172 ms
11,796 KB
testcase_22 AC 373 ms
25,552 KB
evil01.txt AC 252 ms
23,464 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Set (fromList, toAscList)

findMinimumDistance :: [Int] -> Int
findMinimumDistance [] = 0
findMinimumDistance (_ : []) = 0
findMinimumDistance (a : b : []) = b - a
findMinimumDistance (a : b : xs) = min (b - a) $ findMinimumDistance (b : xs)

main :: IO ()
main = print . findMinimumDistance . toAscList. fromList . map read . words . head . drop 1 . lines =<< getContents
0