結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-06-05 11:01:02 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 5,000 ms |
| コード長 | 207 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-12 21:00:33 |
| 合計ジャッジ時間 | 3,153 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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