# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24954 | Hiasat | Shortcut (IOI16_shortcut) | C++14 | 0 ms | 72452 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.
#include "shortcut.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3000;
const ll INF = 1e18;
ll L[N], R[N], mxL[N], mxR[N], pre[N];
vector<int> d, l;
ll dp[N][N];
int n;
ll c;
bool check(ll mid) {
for (int len = 1; len <= n ; ++len) {
for (int i = n - len ; i >= 0 ; --i) {
int j = i + len - 1;
if (len == 1) {
dp[i][j] = INF;
continue;
}
if (pre[j] - pre[i] + d[i] + d[j] > mid)
dp[i][j] = (pre[j] - pre[i]) - d[i] - d[j];
else
dp[i][j] = INF;
dp[i][j] = min(dp[i][j], min(dp[i + 1][j], dp[i][j - 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |