| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1331117 | itzsleepyxd | Stove (JOI18_stove) | C++20 | 14 ms | 1212 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
#define aa(v_) v_.begin(),v_.end()
const int mod = 1e9+7;
void sleep(){
int n,m,k,t,x,y,z,w;
cin >> n >> m;
int a[n-1];
cin >> x;
for (int i = 0; i < n-1; i++)
{
cin >> y;
a[i]=y-x-1;
x=y;
}
sort(a,a+n-1);
k=n;
for (int i = 0; i < n-m; i++)
{
k+=a[i];
}
cout << k << "\n";
}
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int n=1;
//cin >> n;
while (n--) sleep();
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
