# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
408989 | ly20 | The short shank; Redemption (BOI21_prison) | C++17 | 1 ms | 332 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 <bits/stdc++.h>
using namespace std;
const int MAXN = 4123;
int dp[MAXN][MAXN], dir[MAXN][MAXN];
int v[MAXN], mx[MAXN];
int main() {
int n, d, t;
scanf("%d %d %d", &n, &d, &t);
for(int i = 1; i <= n; i++) {
scanf("%d", &v[i]);
mx[i] = 0;
}
for(int i = 1; i <= n; i++) {
for(int j = 0; j <= i; j++) {
mx[j] = max(mx[j], j + t - v[j]);
}
for(int j = 0; j <= n; j++) {
//coloco:
if(v[i] <= t) {
if(j > 0) dp[i][j] = dp[i - 1][j - 1];
else {
dp[i][j] = MAXN;
//printf("%d %d\n", i, j);
}
//printf("%d %d\n", i, j);
if(j == 0) dir[i][j] = 0;
else dir[i][j] = dir[i - 1][ j - 1];
}
else {
int ls = dir[i - 1][j];
Compilation message (stderr)
# | 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... |