| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1170935 | peem | Stove (JOI18_stove) | C++20 | 35 ms | 996 KiB | 
#include <bits/stdc++.h>
using namespace std;
int n,k;
int main() {
  cin>>n>>k;
  int sm=n;
  priority_queue <int> pq;
  int a,b; cin>>a;
  for(int i=1;i<n;++i) {
    cin>>b;
    pq.push(b-a-1);
    if(pq.size()>n-k) pq.pop();
    a=b;
  }
  while(!pq.empty()) {
    sm+=pq.top(); pq.pop();
  }
  cout<<sm;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
