# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
49483 | okaybody10 | Stove (JOI18_stove) | C++11 | 60 ms | 10144 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;
priority_queue<int> pq;
int main()
{
int N,K,past,now; scanf("%d %d %d",&N,&K,&now);
for(int i=1;i<N;i++)
{
past=now;
scanf("%d",&now);
pq.push(-(now-past-1));
}
int ans=N;
for(int i=0;i<N-K;i++)
{
ans-=pq.top();
pq.pop();
}
return !printf("%d\n",ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |