結果

問題 No.21 平均の差
ユーザー SapphireSapphire
提出日時 2019-06-19 14:52:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 161 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,324 KB
最終ジャッジ日時 2023-08-20 07:14:05
合計ジャッジ時間 2,309 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,064 KB
testcase_01 AC 82 ms
15,184 KB
testcase_02 AC 80 ms
15,236 KB
testcase_03 AC 79 ms
15,156 KB
testcase_04 AC 81 ms
15,140 KB
testcase_05 AC 79 ms
15,240 KB
testcase_06 AC 79 ms
15,076 KB
testcase_07 AC 79 ms
15,156 KB
testcase_08 AC 80 ms
15,324 KB
testcase_09 AC 80 ms
15,056 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - b
Syntax OK

ソースコード

diff #

a = gets.to_i
b = gets.to_i
max = -1
min = 1000
a.times do
    num = gets.to_i
    max < num ? max = num : nil
    min > num ? min = num : nil
end
puts max - min
0