結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-26 09:04:52 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 150 bytes |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-11-16 06:21:11 |
| 合計ジャッジ時間 | 4,672 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n Syntax OK
ソースコード
l = gets.to_i
n = gets.to_i
w = gets.split.map(&:to_i)
w.sort!.each_with_index do |width, i|
l -= width
if (l < 0)
puts i
break
end
end