Submission #420086

#TimeUsernameProblemLanguageResultExecution timeMemory
420086temurbek_khujaevBoxes with souvenirs (IOI15_boxes)C++17
10 / 100
2 ms332 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; long long delivery(int N, int K, int L, int p[]) { long long ans = 1ll * N * L; for (int i = 0; i < N; i++) { long long cur = 0; int x = i; int y = i + 1; while (x >= 0) { cur += min(L, p[x] * 2); x -= K; } while (y < N) { cur += min(L, (L - p[y]) * 2); y += K; } ans = min(ans, cur); } return ans; }
#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...