This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "boxes.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define all(s) s.begin(), s.end()
using namespace std;
const int N = 1e7 + 5;
long long dp[N];
long long delivery(int n, int k, int l, int pos[]) {
for (int i = 0; i < n; i++) {
if (i < k) {
dp[i] = min( pos[i] * 2, min( l, (l - pos[0]) * 2 ) );
} else {
dp[i] = dp[i - k] + min( pos[i] * 2, min( l, (l - pos[i - k + 1]) * 2 ) );
}
}
return dp[n - 1];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |