제출 #79384

#제출 시각아이디문제언어결과실행 시간메모리
79384Plurm선물상자 (IOI15_boxes)C++11
0 / 100
2 ms376 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; long long delivery(int N, int K, int L, int p[]) { vector<int> v; for(int i = 0; i < N; i++){ v.emplace_back(min(p[i],L-p[i])); } sort(v.begin(),v.end()); long long cur = 0ll; long long mn = 1e18; for(int i = 0; i < N; i++){ mn = min(mn,cur + (long long)(N-i+K-1)/(long long)K*(long long)L); cur += 2ll*v[i]; } return mn; }
#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...