結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2015-06-26 21:52:15 |
言語 | Ruby (3.4.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 275 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 18,972 KB |
最終ジャッジ日時 | 2024-07-07 17:41:56 |
合計ジャッジ時間 | 7,574 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 31 |
コンパイルメッセージ
Syntax OK
ソースコード
box_width = gets.to_i number = gets.to_i blocks = gets.chomp.split(" ") unless blocks.size == number raise "Number of blocsk is ileagal." end 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