結果

問題 No.156 キャンディー・ボックス
ユーザー yamaghyamagh
提出日時 2015-06-21 21:33:30
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 153 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 11,224 KB
実行使用メモリ 15,504 KB
最終ジャッジ日時 2023-09-21 22:55:46
合計ジャッジ時間 5,058 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,308 KB
testcase_01 RE -
testcase_02 AC 83 ms
15,128 KB
testcase_03 AC 81 ms
15,012 KB
testcase_04 AC 81 ms
15,020 KB
testcase_05 AC 81 ms
15,020 KB
testcase_06 AC 82 ms
14,988 KB
testcase_07 AC 82 ms
14,988 KB
testcase_08 AC 80 ms
15,012 KB
testcase_09 AC 81 ms
15,056 KB
testcase_10 AC 79 ms
15,224 KB
testcase_11 AC 87 ms
15,136 KB
testcase_12 AC 84 ms
15,124 KB
testcase_13 AC 81 ms
15,124 KB
testcase_14 AC 78 ms
14,988 KB
testcase_15 AC 81 ms
15,056 KB
testcase_16 AC 81 ms
15,204 KB
testcase_17 AC 81 ms
15,196 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 81 ms
15,252 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 82 ms
15,016 KB
testcase_25 AC 81 ms
15,200 KB
testcase_26 AC 82 ms
15,196 KB
testcase_27 AC 81 ms
15,260 KB
testcase_28 AC 83 ms
15,252 KB
testcase_29 AC 82 ms
14,984 KB
testcase_30 AC 83 ms
15,160 KB
testcase_31 RE -
testcase_32 AC 80 ms
15,208 KB
testcase_33 AC 82 ms
15,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N,M=gets.split.map(&:to_i)
C=gets.split.map(&:to_i).sort
emp_box=0
C.inject(0) do |s,i|
  if s < M
    emp_box+=1 if i<=M-s
    s+=i
  end
end
p emp_box
0