結果
問題 | No.156 キャンディー・ボックス |
ユーザー |
![]() |
提出日時 | 2018-06-14 23:38:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 334 bytes |
コンパイル時間 | 1,622 ms |
コンパイル使用メモリ | 172,252 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:37:20 |
合計ジャッジ時間 | 3,602 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 3 |
other | AC * 19 WA * 11 |
ソースコード
#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> 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; }