結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
nonmint25sh
|
| 提出日時 | 2017-02-08 16:36:54 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 5,000 ms |
| コード長 | 154 bytes |
| 記録 | |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 9,344 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-12 22:51:04 |
| 合計ジャッジ時間 | 3,465 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n Syntax OK
ソースコード
l = gets.to_i n = gets.to_i width = gets.split.map(&:to_i) sum = 0 counter = 0 width.sort.each do |w| (sum+=w)<=l ? counter+=1 : break end puts counter
nonmint25sh