Submission #846990

# Submission time Handle Problem Language Result Execution time Memory
846990 2023-09-08T21:23:12 Z vjudge1 Soccer Stadium (IOI23_soccer) C++17
48 / 100
4500 ms 2097152 KB
#include "soccer.h"

#include <bits/stdc++.h>
using namespace std;

int biggest_stadium(int N, std::vector<std::vector<int>> F) {
        vector<vector<vector<vector<int>>>> f(N, vector<vector<vector<int>>>(N, vector<vector<int>>(N, vector<int>(N, -N * N))));
        vector<vector<vector<int>>> ok(N, vector<vector<int>>(N, vector<int>(N, 0)));
        for (int i = 0; i < N; i++) {
                for (int j = 0; j < N; j++) {
                        for (int k = j; k < N; k++) {
                                if (F[i][k]) break;
                                f[i][i][j][k] = k - j + 1;
                                ok[i][j][k] = 1;
                        }
                }
        }
        int res = 0;
        for (int r = 0; r < N; r++) {
                for (int l = r; ~l; l--) {
                        for (int a = 0; a < N; a++) {
                                for (int b = a; b < N; b++) {
                                        if (f[l][r][a][b] < 0) continue;
                                        res = max(res, f[l][r][a][b]);
                                        for (int aa = a; aa <= b; aa++) {
                                                for (int bb = aa; bb <= b; bb++) {
                                                        if (l > 0 && ok[l - 1][aa][bb]) f[l - 1][r][aa][bb] = max(f[l - 1][r][aa][bb], f[l][r][a][b] + bb - aa + 1);
                                                        if (r + 1 < N && ok[r + 1][aa][bb]) f[l][r + 1][aa][bb] = max(f[l][r + 1][aa][bb], f[l][r][a][b] + bb - aa + 1);
                                                }
                                        }
                                }
                        }
                }
        }
        return res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB ok
2 Correct 1 ms 344 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 1 ms 344 KB ok
5 Correct 0 ms 344 KB ok
6 Correct 1 ms 344 KB ok
7 Execution timed out 4627 ms 435536 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB ok
2 Correct 1 ms 344 KB ok
3 Correct 0 ms 344 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 344 KB ok
6 Correct 0 ms 344 KB ok
7 Correct 0 ms 344 KB ok
8 Correct 1 ms 344 KB ok
9 Correct 0 ms 348 KB ok
10 Correct 0 ms 344 KB ok
11 Correct 0 ms 344 KB ok
12 Correct 1 ms 344 KB ok
13 Correct 0 ms 344 KB ok
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Correct 0 ms 344 KB ok
3 Correct 1 ms 344 KB ok
4 Correct 0 ms 344 KB ok
5 Correct 0 ms 348 KB ok
6 Correct 0 ms 344 KB ok
7 Correct 0 ms 344 KB ok
8 Correct 0 ms 344 KB ok
9 Correct 1 ms 344 KB ok
10 Correct 0 ms 348 KB ok
11 Correct 0 ms 344 KB ok
12 Correct 0 ms 344 KB ok
13 Correct 1 ms 344 KB ok
14 Correct 0 ms 344 KB ok
15 Correct 0 ms 344 KB ok
16 Correct 0 ms 348 KB ok
17 Correct 0 ms 348 KB ok
18 Correct 0 ms 348 KB ok
19 Correct 0 ms 344 KB ok
20 Correct 0 ms 344 KB ok
21 Correct 0 ms 348 KB ok
22 Correct 0 ms 344 KB ok
23 Correct 1 ms 344 KB ok
24 Correct 0 ms 344 KB ok
25 Correct 0 ms 344 KB ok
26 Correct 1 ms 344 KB ok
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Correct 0 ms 344 KB ok
3 Correct 1 ms 344 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 1 ms 344 KB ok
6 Correct 0 ms 344 KB ok
7 Correct 0 ms 348 KB ok
8 Correct 0 ms 344 KB ok
9 Correct 0 ms 344 KB ok
10 Correct 0 ms 344 KB ok
11 Correct 1 ms 344 KB ok
12 Correct 0 ms 348 KB ok
13 Correct 0 ms 344 KB ok
14 Correct 0 ms 344 KB ok
15 Correct 1 ms 344 KB ok
16 Correct 0 ms 344 KB ok
17 Correct 0 ms 344 KB ok
18 Correct 0 ms 348 KB ok
19 Correct 0 ms 348 KB ok
20 Correct 0 ms 348 KB ok
21 Correct 0 ms 344 KB ok
22 Correct 0 ms 344 KB ok
23 Correct 0 ms 348 KB ok
24 Correct 0 ms 344 KB ok
25 Correct 1 ms 344 KB ok
26 Correct 0 ms 344 KB ok
27 Correct 0 ms 344 KB ok
28 Correct 1 ms 344 KB ok
29 Correct 1 ms 344 KB ok
30 Correct 4 ms 4440 KB ok
31 Correct 3 ms 4440 KB ok
32 Correct 3 ms 4440 KB ok
33 Correct 3 ms 4440 KB ok
34 Correct 3 ms 4440 KB ok
35 Correct 5 ms 4444 KB ok
36 Correct 3 ms 4440 KB ok
37 Correct 4 ms 4700 KB ok
38 Correct 4 ms 4440 KB ok
39 Correct 4 ms 4444 KB ok
40 Correct 33 ms 4440 KB ok
41 Correct 18 ms 4440 KB ok
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Correct 0 ms 344 KB ok
3 Correct 1 ms 344 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 1 ms 344 KB ok
6 Correct 0 ms 344 KB ok
7 Correct 0 ms 348 KB ok
8 Correct 0 ms 344 KB ok
9 Correct 0 ms 344 KB ok
10 Correct 0 ms 344 KB ok
11 Correct 1 ms 344 KB ok
12 Correct 0 ms 348 KB ok
13 Correct 0 ms 344 KB ok
14 Correct 0 ms 344 KB ok
15 Correct 1 ms 344 KB ok
16 Correct 0 ms 344 KB ok
17 Correct 0 ms 344 KB ok
18 Correct 0 ms 348 KB ok
19 Correct 0 ms 348 KB ok
20 Correct 0 ms 348 KB ok
21 Correct 0 ms 344 KB ok
22 Correct 0 ms 344 KB ok
23 Correct 0 ms 348 KB ok
24 Correct 0 ms 344 KB ok
25 Correct 1 ms 344 KB ok
26 Correct 0 ms 344 KB ok
27 Correct 0 ms 344 KB ok
28 Correct 1 ms 344 KB ok
29 Correct 1 ms 344 KB ok
30 Correct 4 ms 4440 KB ok
31 Correct 3 ms 4440 KB ok
32 Correct 3 ms 4440 KB ok
33 Correct 3 ms 4440 KB ok
34 Correct 3 ms 4440 KB ok
35 Correct 5 ms 4444 KB ok
36 Correct 3 ms 4440 KB ok
37 Correct 4 ms 4700 KB ok
38 Correct 4 ms 4440 KB ok
39 Correct 4 ms 4444 KB ok
40 Correct 33 ms 4440 KB ok
41 Correct 18 ms 4440 KB ok
42 Runtime error 1067 ms 2097152 KB Execution killed with signal 9
43 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Correct 0 ms 344 KB ok
3 Correct 1 ms 344 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 1 ms 344 KB ok
6 Correct 0 ms 344 KB ok
7 Correct 1 ms 344 KB ok
8 Execution timed out 4627 ms 435536 KB Time limit exceeded
9 Halted 0 ms 0 KB -