結果

問題 No.135 とりあえず1次元の問題
ユーザー LeonardoneLeonardone
提出日時 2015-10-17 00:12:08
言語 Ruby
(3.3.0)
結果
AC  
実行時間 177 ms / 5,000 ms
コード長 228 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 11,488 KB
実行使用メモリ 29,372 KB
最終ジャッジ日時 2023-09-01 21:42:51
合計ジャッジ時間 3,572 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 175 ms
29,372 KB
testcase_01 AC 81 ms
15,296 KB
testcase_02 AC 80 ms
15,144 KB
testcase_03 AC 80 ms
15,248 KB
testcase_04 AC 81 ms
15,244 KB
testcase_05 AC 80 ms
15,104 KB
testcase_06 AC 81 ms
15,308 KB
testcase_07 AC 81 ms
15,036 KB
testcase_08 AC 81 ms
15,152 KB
testcase_09 AC 81 ms
15,240 KB
testcase_10 AC 81 ms
15,156 KB
testcase_11 AC 81 ms
15,356 KB
testcase_12 AC 81 ms
15,156 KB
testcase_13 AC 80 ms
15,148 KB
testcase_14 AC 83 ms
15,236 KB
testcase_15 AC 81 ms
15,292 KB
testcase_16 AC 83 ms
15,240 KB
testcase_17 AC 83 ms
15,228 KB
testcase_18 AC 82 ms
15,144 KB
testcase_19 AC 84 ms
15,132 KB
testcase_20 AC 84 ms
15,296 KB
testcase_21 AC 137 ms
25,088 KB
testcase_22 AC 177 ms
29,148 KB
evil01.txt AC 171 ms
29,324 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#! ruby
# yukicoder My Practice
# author: Leonardone @ NEETSDKASU

N = gets.to_i
X = gets.chomp.split.map(&:to_i)

x = X.sort.uniq

if x.size > 1
    puts x.zip(x.rotate(1)).map{|x,y| (x - y).abs}[0...-1].min
else
    puts 0
end
0