Submission #133018

#TimeUsernameProblemLanguageResultExecution timeMemory
133018MAMBABoxes with souvenirs (IOI15_boxes)C++14
0 / 100
2 ms376 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define rep(i , j , k) for (int i = j; i < (int)k; i++) typedef long long ll; typedef vector<ll> vl; ll delivery(int N, int K, int Ll, int p[]) { sort(p , p + N); vl L(N) , R(N); rep(i , 0 , N) { L[i] = p[i]; R[i] = Ll - p[i]; if (i >= K) L[i] += L[i - 1]; if (i + K < N) R[i] += R[i + K]; } ll ans = 1e18; rep(i , 1 , N) ans = min(ans , L[i - 1] + R[i]); return ans << 1; }
#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...