結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2015-06-26 21:58:23 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 205 bytes |
コンパイル時間 | 398 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 18,980 KB |
最終ジャッジ日時 | 2024-07-07 17:42:46 |
合計ジャッジ時間 | 8,672 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 18 TLE * 1 -- * 13 |
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - number Syntax OK
ソースコード
box_width = gets.to_i number = gets.to_i blocks = gets.chomp.split(" ") 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