Submission #828762

#TimeUsernameProblemLanguageResultExecution timeMemory
828762cgiosy격자 보존하기 (GA9_preserve)C++17
0 / 100
11 ms1748 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0);cin.tie(0); int M, N, K; cin>>M>>N>>K; int A[N+1], x=0; for(int i=0, y; i<N; i++) cin>>y, A[i]=y-x-1, x=y; A[N]=M-x; K=max(0, 2*N-K+2)>>1; nth_element(A, A+K, A+N+1); for(int i=0; i<K; i++) M-=A[i]; cout<<M-N<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...