結果
| 問題 | No.156 キャンディー・ボックス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-28 13:19:41 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 312 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-05-16 07:05:59 |
| 合計ジャッジ時間 | 4,684 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 4 WA * 26 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n, m = gets.chomp.split(" ").map(&:to_i)
lists = gets.chomp.split(" ").map(&:to_i)
i = -1
while m > -1 do
#lists[i] == 0 ? i += 1 : lists[i] -= 1
lists[i] -= 1
if lists[i] == 0
i += 1
#puts "list#{lists[i - 1]}"
#puts i
end
m -= 1;
end
count = 0
lists.each{|list| count += 1 if list == 0}
puts count