結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-06-05 11:01:02 |
| 言語 | Ruby (4.0.6 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 54 ms / 5,000 ms |
| + 923µs | |
| コード長 | 207 bytes |
| 記録 | |
| コンパイル時間 | 10 ms |
| コンパイル使用メモリ | 9,808 KB |
| 実行使用メモリ | 15,104 KB |
| 最終ジャッジ日時 | 2026-09-25 17:53:30 |
| 合計ジャッジ時間 | 3,631 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n Syntax OK
ソースコード
l=STDIN.gets.to_i
n=STDIN.gets.to_i
as=STDIN.gets.split(" ")
as.size.times do |i|
as[i]=as[i].to_i
end
as=as.sort()
sum=0
ans=0
while as.size>ans
sum+=as[ans]
if sum > l
break
end
ans+=1
end
puts ans
horiesiniti