結果

問題 No.156 キャンディー・ボックス
ユーザー nonokai10nonokai10
提出日時 2018-03-02 15:45:52
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 185 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 11,588 KB
実行使用メモリ 19,752 KB
最終ジャッジ日時 2023-09-02 01:02:25
合計ジャッジ時間 11,798 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
19,752 KB
testcase_01 AC 86 ms
15,080 KB
testcase_02 AC 83 ms
15,176 KB
testcase_03 AC 81 ms
15,152 KB
testcase_04 AC 81 ms
15,108 KB
testcase_05 AC 228 ms
15,476 KB
testcase_06 AC 394 ms
15,260 KB
testcase_07 AC 352 ms
15,264 KB
testcase_08 AC 304 ms
15,204 KB
testcase_09 AC 202 ms
15,144 KB
testcase_10 AC 337 ms
15,200 KB
testcase_11 AC 232 ms
15,224 KB
testcase_12 AC 403 ms
15,288 KB
testcase_13 AC 283 ms
15,396 KB
testcase_14 AC 239 ms
15,220 KB
testcase_15 AC 340 ms
15,184 KB
testcase_16 AC 205 ms
15,260 KB
testcase_17 AC 295 ms
15,256 KB
testcase_18 AC 145 ms
15,212 KB
testcase_19 AC 164 ms
15,224 KB
testcase_20 AC 89 ms
15,168 KB
testcase_21 AC 97 ms
15,416 KB
testcase_22 AC 144 ms
15,308 KB
testcase_23 AC 107 ms
15,136 KB
testcase_24 AC 81 ms
15,124 KB
testcase_25 AC 81 ms
15,296 KB
testcase_26 AC 81 ms
15,060 KB
testcase_27 AC 80 ms
15,344 KB
testcase_28 AC 81 ms
15,312 KB
testcase_29 AC 82 ms
15,268 KB
testcase_30 AC 1,131 ms
15,356 KB
testcase_31 AC 275 ms
15,392 KB
testcase_32 TLE -
testcase_33 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m = gets.split.map(&:to_i)
array = gets.split.map(&:to_i).sort
m.times do
  n.times do |i|
    if array[i] != 0
      array[i] -= 1
      break
    end
  end
end
puts array.count(0)
0