제출 #591294

#제출 시각아이디문제언어결과실행 시간메모리
591294KrisjanisP선물상자 (IOI15_boxes)C++14
10 / 100
1 ms212 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<ll,ll>; long long delivery(int N, int K, int L, int p[]) { if(K==1) { ll res = 0; for(ll i=0;i<N;i++) res += 2*min(p[i],L-p[i]); return res; } else if(K==N) { int res = N; for(ll i=1;i<=N;i++) { ll r = N-i; res = min(res,p[i-1]*2 + (L-p[N-r])*2); } return res; } else return 0; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...