| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1301218 | wojtaszekliszek | Stove (JOI18_stove) | C++20 | 13 ms | 580 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n,k;
cin>>n>>k;
vector<int> space(n-1);
int pop;
cin>>pop;
for(int i=0;i<n-1;i++){
int a;
cin>>a;
space[i]=a-pop-1;
pop=a;
}
sort(space.begin(),space.end());
int odp=n;
for(int i=0;i<n-k;i++){
odp+=space[i];
}
cout<<odp;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
