답안 #1070701

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1070701 2024-08-22T16:56:19 Z zsombor 축구 경기장 (IOI23_soccer) C++17
0 / 100
709 ms 1003348 KB
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;

int n, ans = 0;
vector<vector<bool> > t(3e3, vector<bool>(3e3, false));
vector<vector<vector<int> > > dp(3e3, vector<vector<int> >(3e3, vector<int>(4, -1e9)));

void u(int i, int l, int r, int x, int y, int val) {
    int j = 2 * n * l + r;
    int k = 2 * x + y;
    dp[i][j][k] = val;
}

int q(int i, int l, int r, int x, int y) {
    int j = 2 * n * l + r;
    int k = 2 * x + y;
    return dp[i][j][k];
}

void get_dp(int i, int l, int r, int x, int y) {
    for (int j = l; j <= r; j++) if (t[i][j]) return;
    int mx = 0, L1 = 1, Ln = n, R1 = 1, Rn = n;
    (x ? Ln = l : L1 = l);
    (y ? R1 = r : Rn = r);
    for (int L = L1; L <= Ln; L++) {
        for (int R = R1; R <= Rn; R++) {
            mx = max(mx, q(i - 1, L, R, x, y));
        }
    }
    for (int X = 0; X <= x; X++) {
        for (int Y = 0; Y <= y; Y++) {
            mx = max(mx, q(i - 1, l, r, X, Y));
        }
    }
    mx += (r - l) + 1;
    u(i, l, r, x, y, mx);
    ans = max(ans, mx);
}

int biggest_stadium(int N, std::vector<std::vector<int> > F) {
    n = N;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            t[i][j] = F[i - 1][j - 1];
        }
    }
    for (int i = 1; i <= n; i++) {
        for (int l = 1; l <= n; l++) {
            for (int r = l; r <= n; r++) {
                for (int x = 0; x < 2; x++) {
                    for (int y = 0; y < 2; y++) {
                        get_dp(i, l, r, x, y);
                    }
                }
            }
        }
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 477 ms 495184 KB ok
# 결과 실행 시간 메모리 Grader output
1 Correct 478 ms 494928 KB ok
2 Correct 463 ms 494932 KB ok
3 Correct 478 ms 494932 KB ok
4 Correct 442 ms 494904 KB ok
5 Correct 457 ms 495068 KB ok
6 Correct 457 ms 494964 KB ok
7 Runtime error 709 ms 1003348 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 478 ms 494928 KB ok
2 Correct 463 ms 494932 KB ok
3 Correct 516 ms 494944 KB ok
4 Correct 463 ms 495164 KB ok
5 Incorrect 470 ms 494928 KB wrong
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 477 ms 495184 KB ok
2 Correct 478 ms 494928 KB ok
3 Correct 463 ms 494932 KB ok
4 Correct 516 ms 494944 KB ok
5 Correct 463 ms 495164 KB ok
6 Incorrect 470 ms 494928 KB wrong
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 477 ms 495184 KB ok
2 Correct 478 ms 494928 KB ok
3 Correct 463 ms 494932 KB ok
4 Correct 478 ms 494932 KB ok
5 Correct 442 ms 494904 KB ok
6 Correct 516 ms 494944 KB ok
7 Correct 463 ms 495164 KB ok
8 Incorrect 470 ms 494928 KB wrong
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 477 ms 495184 KB ok
2 Correct 478 ms 494928 KB ok
3 Correct 463 ms 494932 KB ok
4 Correct 478 ms 494932 KB ok
5 Correct 442 ms 494904 KB ok
6 Correct 516 ms 494944 KB ok
7 Correct 463 ms 495164 KB ok
8 Incorrect 470 ms 494928 KB wrong
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 477 ms 495184 KB ok
2 Correct 478 ms 494928 KB ok
3 Correct 463 ms 494932 KB ok
4 Correct 478 ms 494932 KB ok
5 Correct 442 ms 494904 KB ok
6 Correct 457 ms 495068 KB ok
7 Correct 457 ms 494964 KB ok
8 Runtime error 709 ms 1003348 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -