結果

問題 No.135 とりあえず1次元の問題
ユーザー Michae'GonMichae'Gon
提出日時 2015-07-19 07:20:29
言語 Haskell
(9.8.2)
結果
AC  
実行時間 423 ms / 5,000 ms
コード長 238 bytes
コンパイル時間 11,490 ms
コンパイル使用メモリ 158,656 KB
実行使用メモリ 41,760 KB
最終ジャッジ日時 2023-09-01 03:57:28
合計ジャッジ時間 5,247 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 422 ms
40,988 KB
testcase_01 AC 3 ms
7,280 KB
testcase_02 AC 3 ms
7,216 KB
testcase_03 AC 3 ms
7,228 KB
testcase_04 AC 3 ms
7,752 KB
testcase_05 AC 3 ms
7,824 KB
testcase_06 AC 4 ms
7,956 KB
testcase_07 AC 3 ms
7,864 KB
testcase_08 AC 3 ms
7,848 KB
testcase_09 AC 3 ms
7,820 KB
testcase_10 AC 3 ms
7,796 KB
testcase_11 AC 3 ms
7,744 KB
testcase_12 AC 4 ms
9,544 KB
testcase_13 AC 3 ms
7,980 KB
testcase_14 AC 7 ms
11,412 KB
testcase_15 AC 5 ms
9,588 KB
testcase_16 AC 12 ms
11,428 KB
testcase_17 AC 7 ms
11,420 KB
testcase_18 AC 4 ms
8,200 KB
testcase_19 AC 7 ms
11,408 KB
testcase_20 AC 6 ms
11,260 KB
testcase_21 AC 273 ms
41,760 KB
testcase_22 AC 423 ms
41,224 KB
evil01.txt AC 342 ms
40,316 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.List
main = getLine >> getLine >>= print . solve . map head . group . sort . map read . words

solve :: [Int] -> Int
solve [] = 0
solve (_ : []) = 0
solve (x : y : []) = y - x
solve (x : y : zs) = min (y - x) $ solve (y : zs)
0