# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
539075 |
2022-03-18T11:07:43 Z |
ivaziva |
Stove (JOI18_stove) |
C++14 |
|
1 ms |
212 KB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int niz[n];
int pauze[n];
for (int i=0;i<n;i++)
{
cin>>niz[i];
if (i!=0)
{
pauze[i-1]=niz[i]-niz[i-1];
}
}
sort(pauze,pauze+n-1);
int t=n;
for (int i=0;i<n-k;i++)
{
t+=pauze[i];
}
cout<<t<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |