結果

問題 No.716 距離
ユーザー ducktailducktail
提出日時 2018-07-29 14:38:52
言語 Haskell
(9.8.2)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 8,224 ms
コンパイル使用メモリ 158,668 KB
実行使用メモリ 11,240 KB
最終ジャッジ日時 2023-09-24 21:26:53
合計ジャッジ時間 10,558 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
11,184 KB
testcase_01 AC 12 ms
11,240 KB
testcase_02 AC 12 ms
11,220 KB
testcase_03 AC 8 ms
11,200 KB
testcase_04 AC 12 ms
11,200 KB
testcase_05 AC 8 ms
11,164 KB
testcase_06 AC 13 ms
11,236 KB
testcase_07 AC 2 ms
6,884 KB
testcase_08 AC 3 ms
7,084 KB
testcase_09 AC 2 ms
7,048 KB
testcase_10 AC 8 ms
11,204 KB
testcase_11 AC 6 ms
10,064 KB
testcase_12 AC 13 ms
11,124 KB
testcase_13 AC 12 ms
11,112 KB
testcase_14 AC 3 ms
7,020 KB
testcase_15 AC 13 ms
11,172 KB
testcase_16 AC 7 ms
10,892 KB
testcase_17 AC 8 ms
11,108 KB
testcase_18 AC 4 ms
7,752 KB
testcase_19 AC 6 ms
10,288 KB
testcase_20 AC 3 ms
7,176 KB
testcase_21 AC 3 ms
7,892 KB
testcase_22 AC 5 ms
9,064 KB
testcase_23 AC 3 ms
7,672 KB
testcase_24 AC 8 ms
11,084 KB
testcase_25 AC 6 ms
10,028 KB
testcase_26 AC 7 ms
11,104 KB
testcase_27 AC 7 ms
11,136 KB
testcase_28 AC 4 ms
7,780 KB
testcase_29 AC 7 ms
11,184 KB
testcase_30 AC 7 ms
11,068 KB
testcase_31 AC 7 ms
11,120 KB
testcase_32 AC 7 ms
11,228 KB
testcase_33 AC 7 ms
11,176 KB
testcase_34 AC 7 ms
10,756 KB
testcase_35 AC 3 ms
7,156 KB
testcase_36 AC 4 ms
8,692 KB
testcase_37 AC 3 ms
7,328 KB
testcase_38 AC 6 ms
9,596 KB
testcase_39 AC 7 ms
11,104 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 Control.Applicative ((<$>))

main :: IO ()
main = do
  n <- readLn
  solve n <$> map read <$> words <$> getLine >>= mapM_ print

solve :: Int -> [Int] -> [Int]
solve n xs = let mn = minimum  $ zipWith (-) (tail xs) xs
                 mx = xs !! (n-1) - xs !! 0
             in [mn, mx]
0