제출 #61734

#제출 시각아이디문제언어결과실행 시간메모리
61734nvmdava선물상자 (IOI15_boxes)C++17
0 / 100
2 ms376 KiB
#include "boxes.h" using namespace std; #include<bits/stdc++.h> long long delivery(int n, int k, int l, int p[]) { int left; int i = 0; while(p[i] == 0)i++; int t = -1; long long ans = (long long)(n + k - i - 1) / k * l; i += k - 1; while(i < n && p[i] * 2 < l){ if(i == t){ break; } ans = ans - l + p[i] * 2; t = max(i + k, n - 1); i = t; } left = n - i; t = -1; int j = n - k; while(l < p[j] * 2){ if(t == j){ break; } ans = ans + l - p[j] * 2; t = max(0 , j - k); left -=t - j; j = 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...