結果
問題 |
No.5 数字のブロック
|
ユーザー |
|
提出日時 | 2016-12-03 20:03:47 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 234 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,672 KB |
最終ジャッジ日時 | 2024-11-27 14:34:00 |
合計ジャッジ時間 | 4,135 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 14 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - count Syntax OK
ソースコード
@width = gets.chomp.to_i count = gets.chomp.to_i blocks = gets.chomp.split(" ").map(&:to_i).sort @current_width = 0 blocks.each_with_index do |b, i| @current_width += b if @current_width >= @width puts i exit end end