| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 651372 | pauloamed | Stove (JOI18_stove) | C++14 | 52 ms | 3236 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;
#define int long long
int32_t main(){
int n, k; cin >> n >> k;
vector<int> v(n);
for(auto &x : v) cin >> x;
priority_queue<int> pq;
for(int i = 1; i < n; ++i){
pq.push(v[i] - v[i - 1] - 1);
}
int ans = v.back() - v.front() + 1;
for(int i = 1; i < k; ++i){
ans -= pq.top();
pq.pop();
}
cout << ans << "\n";
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
