| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 734063 | LCJLY | Stove (JOI18_stove) | C++14 | 25 ms | 2260 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> //needa retype template incase bret reynold yeah bruh moment ill me
using namespace std;
#define int long long
typedef pair<int,int>pii;
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n,k;
cin >> n >> k;
int arr[n+5];
for(int x=1;x<=n;x++){
cin >> arr[x];
}
priority_queue<int>pq;
for(int x=2;x<=n;x++){
pq.push(arr[x]-arr[x-1]-1);
}
int counter=arr[n]-arr[1]+1;
for(int bruh=0; bruh<k-1; ++bruh) {
auto cur=pq.top();
counter-=cur;
pq.pop();
}
cout << counter;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
