結果

問題 No.135 とりあえず1次元の問題
ユーザー MaboyMaboy
提出日時 2021-06-15 23:01:30
言語 Swift
(5.10.0)
結果
RE  
実行時間 -
コード長 218 bytes
コンパイル時間 8,248 ms
コンパイル使用メモリ 138,560 KB
実行使用メモリ 14,524 KB
最終ジャッジ日時 2023-08-27 19:46:00
合計ジャッジ時間 10,887 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
13,912 KB
testcase_01 AC 3 ms
8,336 KB
testcase_02 AC 3 ms
8,336 KB
testcase_03 RE -
testcase_04 AC 4 ms
8,272 KB
testcase_05 AC 4 ms
8,336 KB
testcase_06 AC 3 ms
8,324 KB
testcase_07 AC 4 ms
8,316 KB
testcase_08 AC 3 ms
8,212 KB
testcase_09 AC 3 ms
8,372 KB
testcase_10 AC 3 ms
8,208 KB
testcase_11 AC 4 ms
8,372 KB
testcase_12 AC 4 ms
8,404 KB
testcase_13 AC 4 ms
8,328 KB
testcase_14 AC 5 ms
8,372 KB
testcase_15 AC 4 ms
8,316 KB
testcase_16 AC 5 ms
8,320 KB
testcase_17 AC 4 ms
8,380 KB
testcase_18 AC 4 ms
8,328 KB
testcase_19 AC 5 ms
8,380 KB
testcase_20 AC 4 ms
8,364 KB
testcase_21 AC 164 ms
13,652 KB
testcase_22 AC 158 ms
14,524 KB
evil01.txt AC 162 ms
14,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let N = Int(readLine()!)
var X = readLine()?.split(separator: " ").map{Int($0)!}
var S:Set = Set<Int>(X!)
X = Array(S).sorted()
var L = [Int]()

for i in 0...X!.count - 2{
    L += [X![i + 1] - X![i]]
}
print(L.min()!)
0