結果

問題 No.143 豆
ユーザー abinullabinull
提出日時 2021-11-28 17:38:11
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 1,000 ms
コード長 142 bytes
コンパイル時間 727 ms
コンパイル使用メモリ 11,188 KB
実行使用メモリ 15,404 KB
最終ジャッジ日時 2023-09-14 04:51:20
合計ジャッジ時間 2,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
15,080 KB
testcase_01 AC 67 ms
15,340 KB
testcase_02 AC 68 ms
15,112 KB
testcase_03 AC 67 ms
15,292 KB
testcase_04 AC 69 ms
15,108 KB
testcase_05 AC 72 ms
15,164 KB
testcase_06 AC 72 ms
15,332 KB
testcase_07 AC 71 ms
15,228 KB
testcase_08 AC 75 ms
15,404 KB
testcase_09 AC 76 ms
15,360 KB
testcase_10 AC 80 ms
15,044 KB
testcase_11 AC 77 ms
15,232 KB
testcase_12 AC 76 ms
15,080 KB
testcase_13 AC 72 ms
15,236 KB
testcase_14 AC 70 ms
15,112 KB
testcase_15 AC 70 ms
15,340 KB
testcase_16 AC 66 ms
15,136 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:8: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

k, n, _f = gets.chomp!.split(' ').map(&:to_i)
a = gets.chomp!.split(' ').map(&:to_i)

r = k * n - a.sum
if r >= 0
  puts r
else
  puts -1
end
0