結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2015-06-26 22:09:10 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 222 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,800 KB |
最終ジャッジ日時 | 2024-07-07 17:43:17 |
合計ジャッジ時間 | 3,597 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 34 |
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - number Syntax OK
ソースコード
box_width = gets.to_i number = gets.to_i blocks = gets.chomp.split(" ") block.map!(&:to_i) blocks.sort! i = 0 width = 0 while true width += blocks[i].to_i if width > box_width break else i += 1 end end puts i