# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116646 | roseanne_pcy | Boxes with souvenirs (IOI15_boxes) | C++14 | 709 ms | 249988 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifdef atom
#include "grader.cpp"
#else
#include "boxes.h"
#endif
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
#define X first
#define Y second
#define vi vector<int>
#define vvi vector< vi >
#define vii vector< ii >
#define mp make_pair
#define pb push_back
const int maxn = 1e7+5;
ll dp1[maxn];
ll dp2[maxn];
int a[maxn];
long long delivery(int n, int k, int l, int p[])
{
for(int i = 1; i<= n; i++) a[i] = p[i-1];
for(int i = 1; i<= k; i++) dp1[i] = 2*a[i];
for(int i = n; i> n-k; i--) dp2[i] = 2*(l-a[i]);
for(int i = k+1; i<= n; i++) dp1[i] = 2*a[i]+dp1[i-k];
for(int i = n-k; i>= 1; i--) dp2[i] = 2*(l-a[i])+dp2[i+k];
ll best = 1e18;
for(int i = 0; i<= n; i++)
{
# | 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... |