Submission #64936

#TimeUsernameProblemLanguageResultExecution timeMemory
64936mirbek01Boxes with souvenirs (IOI15_boxes)C++17
50 / 100
2063 ms4280 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 = 1e18; for(int i = 0; i < N; i ++){ long long res = 0; for(int j = i; j >= 0; j -= K){ res += p[j] + min(p[j], L - p[j]); } for(int j = i + 1; j < N; j += K){ res += (L - p[j]) + min(p[j], L - p[j]); } ans = min(ans, res); } long long res = 0; for(int j = 0; j < N; j += K){ res += (L - p[j]) + min(p[j], L - p[j]); } ans = min(ans, res); 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...