Submission #1091540

#TimeUsernameProblemLanguageResultExecution timeMemory
1091540triplem5dsBoxes with souvenirs (IOI15_boxes)C++14
0 / 100
2 ms752 KiB
#include "boxes.h" #include <bits/stdc++.h> long long cost[10000007]; long long delivery(int N, int K, int L, int p[]) { long long cur = 0; for(int i = 0, j = 0; i < N; i++) { if((j+=1) == K) j = 0; cost[i] = cur + p[i]; if(j == 0) cur += p[i]; } for(int i = N - 1, j = 0; i >= 0; i++) { if((j+=1) == K) j = 0; cost[i] += cur + L - p[i]; if(j == 0) cur += L - p[i]; } return *std::min_element(cost,cost+N); }
#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...