結果

問題 No.156 キャンディー・ボックス
ユーザー fshutofshuto
提出日時 2019-04-30 11:35:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 169 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-08-28 13:35:37
合計ジャッジ時間 7,023 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,108 KB
testcase_01 WA -
testcase_02 AC 77 ms
15,180 KB
testcase_03 AC 77 ms
15,332 KB
testcase_04 AC 78 ms
15,160 KB
testcase_05 WA -
testcase_06 AC 135 ms
15,264 KB
testcase_07 AC 130 ms
15,108 KB
testcase_08 AC 131 ms
15,288 KB
testcase_09 AC 108 ms
15,288 KB
testcase_10 AC 132 ms
15,284 KB
testcase_11 AC 123 ms
15,108 KB
testcase_12 AC 136 ms
15,332 KB
testcase_13 AC 117 ms
15,232 KB
testcase_14 AC 123 ms
15,160 KB
testcase_15 AC 132 ms
15,172 KB
testcase_16 AC 108 ms
15,080 KB
testcase_17 AC 119 ms
15,320 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 79 ms
15,220 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 78 ms
15,360 KB
testcase_25 AC 78 ms
15,080 KB
testcase_26 AC 77 ms
15,128 KB
testcase_27 AC 78 ms
15,336 KB
testcase_28 WA -
testcase_29 AC 76 ms
15,304 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1,001 ms
15,328 KB
testcase_33 AC 999 ms
15,076 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m = gets.split.map(&:to_i)
cs = gets.split.map(&:to_i).sort
i = 0
while m > 0 do
  if cs[i] > 0
    cs[i] -= 1
    m -= 1
  end
  i += 1
  i %= n
end
puts cs.count(0)
0