제출 #1082226

#제출 시각아이디문제언어결과실행 시간메모리
1082226raphael_heuchl선물상자 (IOI15_boxes)C++14
100 / 100
422 ms137524 KiB
#include "boxes.h" #include <iostream> #define INF 5'000'000'000'000'000'000 #define MIN(a, b) ((a) < (b) ? (a) : (b)) typedef long long ll; ll delivery(int N, int K, int L, int p[]) { ll best = INF; for (ll i = 0; i < K; ++i) { ll sum = MIN(0, L - 2*p[0]) + MIN(L, 2*p[i]); ll pos = i; while (pos < N-1) sum += MIN(L - (p[pos+1]<<1), 0), pos = MIN(pos+K, N-1), sum += MIN(L, p[pos]<<1); best = MIN(best, sum); } return best; }
#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...