| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 468581 | PiejanVDC | Stove (JOI18_stove) | C++17 | 59 ms | 1868 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;
signed main() {
int n,k; cin>>n>>k;
int prev; cin>>prev;
priority_queue<int>pq;
for(int i = 1 ; i < n ; i++) {
int x; cin>>x;
pq.push(-x+prev+1);
prev=x;
}
int ans=n;
while(n > k) {
ans+=-(pq.top());
pq.pop();
n--;
}
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... | ||||
