結果
| 問題 |
No.156 キャンディー・ボックス
|
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-06-14 23:39:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 103 ms / 2,000 ms |
| コード長 | 360 bytes |
| コンパイル時間 | 1,587 ms |
| コンパイル使用メモリ | 171,148 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-05 16:20:09 |
| 合計ジャッジ時間 | 2,661 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
Int n,m;
cin>>n>>m;
priority_queue<Int,vector<Int>,greater<Int> > q;
for(Int i=0;i<n;i++){
Int c;
cin>>c;
q.emplace(c);
}
while(m--){
Int s=q.top();q.pop();
if(s-1) q.emplace(s-1);
}
cout<<n-q.size()<<endl;
return 0;
}
beet