結果
問題 |
No.5 数字のブロック
|
ユーザー |
|
提出日時 | 2016-12-03 20:01:43 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 233 bytes |
コンパイル時間 | 556 ms |
コンパイル使用メモリ | 7,204 KB |
実行使用メモリ | 12,672 KB |
最終ジャッジ日時 | 2024-11-27 14:33:56 |
合計ジャッジ時間 | 4,559 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 10 |
コンパイルメッセージ
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