제출 #283519

#제출 시각아이디문제언어결과실행 시간메모리
283519FlashGamezzz선물상자 (IOI15_boxes)C++14
10 / 100
1 ms416 KiB
#include <iostream> #include <cstdlib> #include <cstdio> #include <fstream> #include <algorithm> #include <string> #include <utility> #include <vector> #include "boxes.h" using namespace std; long long delivery(int N, int K, int L, int p[]) { long long ans = 1000000000000000000; for (long i = 0; i < K && i < N; i++){ long long t = min(L, min(2*p[i], 2*(L-p[0]))); long l = i+1, r = i+K-1; while (true){ if (r >= N){ if (l < N){ r = N-1; t += min(L, min(2*p[r], 2*(L-p[l]))); } break; } t += min(L, min(2*p[r], 2*(L-p[l]))); l += K; r += K; } ans = min(ans, t); } 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...