結果

問題 No.21 平均の差
ユーザー Lo_OTLo_OT
提出日時 2018-01-01 22:42:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 143 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 15,300 KB
最終ジャッジ日時 2023-08-24 15:48:03
合計ジャッジ時間 2,539 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,008 KB
testcase_01 AC 77 ms
15,152 KB
testcase_02 AC 78 ms
15,300 KB
testcase_03 AC 77 ms
15,096 KB
testcase_04 AC 77 ms
15,212 KB
testcase_05 AC 78 ms
15,004 KB
testcase_06 AC 78 ms
15,128 KB
testcase_07 AC 78 ms
15,004 KB
testcase_08 AC 77 ms
15,064 KB
testcase_09 AC 77 ms
15,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

ar = Array.new
n = gets.to_i
n = gets.to_i
while line = gets
    num = line.to_i
    ar.push(num)
end

ar = ar.sort.reverse
puts ar[0] - ar[-1]
0