結果

問題 No.156 キャンディー・ボックス
ユーザー LED
提出日時 2019-02-03 05:36:29
言語 Ruby
(3.4.1)
結果
AC  
実行時間 932 ms / 2,000 ms
コード長 111 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-07-05 16:24:35
合計ジャッジ時間 5,881 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,m=gets.split.map(&:to_i)
c=gets.split.map(&:to_i).sort
e=0
m.times{|i|c.shift+(e+=1) if (c[0]-=1)==0 }
puts e
0