結果
| 問題 |
No.5 数字のブロック
|
| コンテスト | |
| ユーザー |
yuki__ninoai
|
| 提出日時 | 2016-02-16 20:45:46 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 271 bytes |
| コンパイル時間 | 43 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 13,056 KB |
| 最終ジャッジ日時 | 2024-09-22 07:18:35 |
| 合計ジャッジ時間 | 4,149 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 34 |
コンパイルメッセージ
Main.rb:8: warning: assigned but unused variable - count Syntax OK
ソースコード
# Here your code !
length = gets.to_i #16
num = gets.to_i #3
s = gets.chomp.split(" ").map(&:to_i).sort #[5, 7, 10]
sum = 0
count = 0
i = 0
if s.inject == length
puts num
else
while sum < length
sum = sum + s[i]
i = i + 1
end
puts i - 1
end
yuki__ninoai