| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 660332 | GoldLight | Stove (JOI18_stove) | C++17 | 24 ms | 1872 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
void fast(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
priority_queue<int, vector<int>, greater<int>> pq;
int main(){
fast();
int n, k; cin>>n>>k;
int baru, last;
for(int i=1; i<=n; i++){
cin>>baru;
if(i>1){
pq.push(baru-last-1);
}
last=baru;
}
int ans=n;
for(int i=1; i<=n-k; i++){
ans+=pq.top();
pq.pop();
}
cout<<ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
