結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-01-27 22:53:09 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 236 bytes |
| コンパイル時間 | 71 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-09-21 17:42:21 |
| 合計ジャッジ時間 | 2,390 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 17 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - family Main.rb:2: warning: assigned but unused variable - old Syntax OK
ソースコード
peace, bag, family = gets.chomp.split(" ").map &:to_i
old = gets.chomp.split(" ").map &:to_i
total_beans = peace * bag
total_years = 0 #old.inject
if total_beans >= total_years
puts "#{total_beans - total_years}"
else
puts "-1"
end