結果

問題 No.716 距離
ユーザー YoteichiYoteichi
提出日時 2018-08-05 04:30:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 310 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 16,100 KB
最終ジャッジ日時 2023-10-19 22:01:42
合計ジャッジ時間 9,375 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 310 ms
16,100 KB
testcase_01 AC 309 ms
16,100 KB
testcase_02 AC 309 ms
16,100 KB
testcase_03 AC 309 ms
16,100 KB
testcase_04 AC 308 ms
16,100 KB
testcase_05 AC 309 ms
16,100 KB
testcase_06 AC 310 ms
16,100 KB
testcase_07 AC 89 ms
16,100 KB
testcase_08 AC 88 ms
16,100 KB
testcase_09 AC 88 ms
16,100 KB
testcase_10 AC 238 ms
16,100 KB
testcase_11 AC 129 ms
16,100 KB
testcase_12 AC 291 ms
16,100 KB
testcase_13 AC 219 ms
16,100 KB
testcase_14 AC 87 ms
16,100 KB
testcase_15 AC 266 ms
16,100 KB
testcase_16 AC 161 ms
16,100 KB
testcase_17 AC 282 ms
16,100 KB
testcase_18 AC 90 ms
16,100 KB
testcase_19 AC 138 ms
16,100 KB
testcase_20 AC 88 ms
16,100 KB
testcase_21 AC 91 ms
16,100 KB
testcase_22 AC 108 ms
16,096 KB
testcase_23 AC 89 ms
16,096 KB
testcase_24 AC 237 ms
16,100 KB
testcase_25 AC 129 ms
16,100 KB
testcase_26 AC 176 ms
16,100 KB
testcase_27 AC 200 ms
16,100 KB
testcase_28 AC 88 ms
16,100 KB
testcase_29 AC 182 ms
16,100 KB
testcase_30 AC 175 ms
16,100 KB
testcase_31 AC 223 ms
16,100 KB
testcase_32 AC 196 ms
16,100 KB
testcase_33 AC 186 ms
16,100 KB
testcase_34 AC 156 ms
16,100 KB
testcase_35 AC 87 ms
16,100 KB
testcase_36 AC 100 ms
16,100 KB
testcase_37 AC 88 ms
16,092 KB
testcase_38 AC 120 ms
16,100 KB
testcase_39 AC 184 ms
16,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
a = gets.split.map(&:to_i)
min = Float::INFINITY
max = -Float::INFINITY
(0...n).each do |i|
    (0...n).each do |j|
        next if i == j
        min = [min, (a[i] - a[j]).abs].min
        max = [max, (a[i] - a[j]).abs].max
    end
end
puts min, max
0