結果

問題 No.143 豆
ユーザー 山根直也山根直也
提出日時 2020-04-29 13:21:13
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 1,000 ms
コード長 167 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 15,336 KB
最終ジャッジ日時 2023-09-30 17:50:10
合計ジャッジ時間 2,635 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
14,996 KB
testcase_01 AC 80 ms
15,232 KB
testcase_02 AC 81 ms
15,092 KB
testcase_03 AC 80 ms
15,336 KB
testcase_04 AC 80 ms
15,300 KB
testcase_05 AC 80 ms
15,260 KB
testcase_06 AC 79 ms
15,096 KB
testcase_07 AC 81 ms
15,248 KB
testcase_08 AC 82 ms
15,268 KB
testcase_09 AC 83 ms
15,132 KB
testcase_10 AC 81 ms
15,152 KB
testcase_11 AC 83 ms
15,296 KB
testcase_12 AC 82 ms
15,176 KB
testcase_13 AC 81 ms
15,296 KB
testcase_14 AC 82 ms
15,292 KB
testcase_15 AC 80 ms
15,264 KB
testcase_16 AC 80 ms
15,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s=gets.chomp.split(" ")
s.map!{|x|x.to_i}
old=gets.chomp.split(" ")
old.map!{|x|x.to_i}
surplus=s[0]*s[1]-old.sum
if surplus<0
    puts "-1"
else
    puts surplus
end
0