結果
| 問題 |
No.5 数字のブロック
|
| コンテスト | |
| ユーザー |
riokuma0810
|
| 提出日時 | 2015-09-04 00:48:10 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 161 bytes |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 12,672 KB |
| 最終ジャッジ日時 | 2024-07-18 23:39:44 |
| 合計ジャッジ時間 | 4,104 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 30 |
コンパイルメッセージ
Main.rb:13: warning: mismatched indentations at 'end' with 'else' at 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)
s = 0
ii = 0
w.sort.each do |i|
if s < l
s += i
ii += 1
else
p ii
break
end
end
riokuma0810