# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754592 | 2023-06-08T06:43:20 Z | matere | Stove (JOI18_stove) | C++14 | 1 ms | 340 KB |
#include<bits/stdc++.h> using namespace std; vector<int>dist; int n,k,a[200001]; int main(){ cin>>n>>k; a[0]=-1999999999; for(int i=1;i<=n;i++){ cin>>a[i]; dist.push_back(a[i]-a[i-1]-1); } int ans=n; sort(dist.begin(),dist.end()); dist.pop_back(); for(int i=1;i<=k;i++){ dist.pop_back(); } for(int i=0;i<=dist.size();i++){ ans+=dist[i]; } cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
6 | Halted | 0 ms | 0 KB | - |