結果

問題 No.135 とりあえず1次元の問題
ユーザー chike_pluschike_plus
提出日時 2019-04-04 10:29:52
言語 F#
(.NET 7)
結果
AC  
実行時間 167 ms / 5,000 ms
コード長 432 bytes
コンパイル時間 3,653 ms
コンパイル使用メモリ 157,068 KB
実行使用メモリ 42,124 KB
最終ジャッジ日時 2023-08-26 09:19:13
合計ジャッジ時間 7,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 167 ms
39,688 KB
testcase_01 AC 68 ms
24,352 KB
testcase_02 AC 68 ms
24,548 KB
testcase_03 AC 68 ms
24,296 KB
testcase_04 AC 67 ms
20,376 KB
testcase_05 AC 67 ms
22,528 KB
testcase_06 AC 67 ms
22,524 KB
testcase_07 AC 68 ms
22,408 KB
testcase_08 AC 68 ms
22,476 KB
testcase_09 AC 68 ms
24,352 KB
testcase_10 AC 67 ms
20,268 KB
testcase_11 AC 68 ms
22,340 KB
testcase_12 AC 76 ms
24,460 KB
testcase_13 AC 68 ms
22,364 KB
testcase_14 AC 76 ms
22,540 KB
testcase_15 AC 76 ms
22,400 KB
testcase_16 AC 77 ms
22,408 KB
testcase_17 AC 78 ms
22,520 KB
testcase_18 AC 76 ms
22,388 KB
testcase_19 AC 77 ms
24,456 KB
testcase_20 AC 76 ms
22,680 KB
testcase_21 AC 159 ms
42,124 KB
testcase_22 AC 167 ms
41,680 KB
evil01.txt AC 165 ms
39,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let ``No.135 とりあえず1次元の問題``() =

  let n = stdin.ReadLine() |> int
  let xn =
     stdin.ReadLine().Split(' ')
    |> Array.map (int)
    |> Array.sort

  seq {
    for i in [2..xn.Length] do
     if xn.[i-1] <> xn.[i-2] then 
      yield (xn.[i-1] - xn.[i-2]) 
  }
  |> fun sq ->
     if   sq |> Seq.length = 0 then 0
     else sq |> Seq.min 
  |> stdout.WriteLine
  
``No.135 とりあえず1次元の問題``()
0