#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,sse4")
const int mxn = 33;
int N;
int dp[mxn][mxn][mxn][mxn];
int biggest_stadium(int NN, std::vector<std::vector<int>> F){
N = NN;
memset(dp,-1,sizeof(dp));
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;
dp[i][i][j][k] = k-j+1;
}
}
}
for(int wid = 1;wid<N;wid++){
for(int sr = 0;sr+wid<N;sr++){
int er = sr+wid;
for(int l = 0;l<N;l++){
for(int r = l;r<N;r++){
for(int tl = l;tl<=r;tl++){
for(int tr = tl;tr<=r;tr++){
if(dp[sr+1][er][l][r] != -1&&dp[sr][sr][tl][tr] != -1)
dp[sr][er][tl][tr] = max(dp[sr][er][tl][tr],dp[sr+1][er][l][r]+dp[sr][sr][tl][tr]);
if(dp[sr][er-1][l][r] != -1&&dp[er][er][tl][tr] != -1)
dp[sr][er][tl][tr] = max(dp[sr][er][tl][tr],dp[sr][er-1][l][r]+dp[er][er][tl][tr]);
}
}
}
}
}
}
int ans = 0;
for(auto &i:dp)for(auto &j:i)for(auto &ii:j)for(auto &jj:ii)ans = max(ans,jj);
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
2 |
Correct |
1 ms |
4956 KB |
ok |
3 |
Correct |
2 ms |
4956 KB |
ok |
4 |
Correct |
1 ms |
4956 KB |
ok |
5 |
Correct |
1 ms |
4956 KB |
ok |
6 |
Correct |
2 ms |
4956 KB |
ok |
7 |
Runtime error |
5 ms |
10076 KB |
Execution killed with signal 11 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
2 |
Correct |
1 ms |
4956 KB |
ok |
3 |
Correct |
1 ms |
4952 KB |
ok |
4 |
Correct |
1 ms |
4952 KB |
ok |
5 |
Correct |
1 ms |
4956 KB |
ok |
6 |
Correct |
1 ms |
4956 KB |
ok |
7 |
Correct |
2 ms |
5048 KB |
ok |
8 |
Correct |
1 ms |
4952 KB |
ok |
9 |
Correct |
1 ms |
5080 KB |
ok |
10 |
Correct |
1 ms |
4956 KB |
ok |
11 |
Correct |
2 ms |
5212 KB |
ok |
12 |
Correct |
1 ms |
4956 KB |
ok |
13 |
Correct |
1 ms |
4956 KB |
ok |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
2 |
Correct |
1 ms |
4956 KB |
ok |
3 |
Correct |
1 ms |
4956 KB |
ok |
4 |
Correct |
1 ms |
4952 KB |
ok |
5 |
Correct |
1 ms |
4952 KB |
ok |
6 |
Correct |
1 ms |
4956 KB |
ok |
7 |
Correct |
1 ms |
4956 KB |
ok |
8 |
Correct |
2 ms |
5048 KB |
ok |
9 |
Correct |
1 ms |
4952 KB |
ok |
10 |
Correct |
1 ms |
5080 KB |
ok |
11 |
Correct |
1 ms |
4956 KB |
ok |
12 |
Correct |
2 ms |
5212 KB |
ok |
13 |
Correct |
1 ms |
4956 KB |
ok |
14 |
Correct |
1 ms |
4956 KB |
ok |
15 |
Correct |
3 ms |
4956 KB |
ok |
16 |
Correct |
1 ms |
4956 KB |
ok |
17 |
Correct |
1 ms |
4956 KB |
ok |
18 |
Correct |
1 ms |
4956 KB |
ok |
19 |
Correct |
1 ms |
4956 KB |
ok |
20 |
Correct |
1 ms |
5056 KB |
ok |
21 |
Correct |
1 ms |
4956 KB |
ok |
22 |
Correct |
1 ms |
4952 KB |
ok |
23 |
Correct |
1 ms |
4956 KB |
ok |
24 |
Correct |
1 ms |
4956 KB |
ok |
25 |
Correct |
1 ms |
5052 KB |
ok |
26 |
Correct |
1 ms |
4956 KB |
ok |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
2 |
Correct |
1 ms |
4956 KB |
ok |
3 |
Correct |
1 ms |
4956 KB |
ok |
4 |
Correct |
2 ms |
4956 KB |
ok |
5 |
Correct |
1 ms |
4956 KB |
ok |
6 |
Correct |
1 ms |
4952 KB |
ok |
7 |
Correct |
1 ms |
4952 KB |
ok |
8 |
Correct |
1 ms |
4956 KB |
ok |
9 |
Correct |
1 ms |
4956 KB |
ok |
10 |
Correct |
2 ms |
5048 KB |
ok |
11 |
Correct |
1 ms |
4952 KB |
ok |
12 |
Correct |
1 ms |
5080 KB |
ok |
13 |
Correct |
1 ms |
4956 KB |
ok |
14 |
Correct |
2 ms |
5212 KB |
ok |
15 |
Correct |
1 ms |
4956 KB |
ok |
16 |
Correct |
1 ms |
4956 KB |
ok |
17 |
Correct |
3 ms |
4956 KB |
ok |
18 |
Correct |
1 ms |
4956 KB |
ok |
19 |
Correct |
1 ms |
4956 KB |
ok |
20 |
Correct |
1 ms |
4956 KB |
ok |
21 |
Correct |
1 ms |
4956 KB |
ok |
22 |
Correct |
1 ms |
5056 KB |
ok |
23 |
Correct |
1 ms |
4956 KB |
ok |
24 |
Correct |
1 ms |
4952 KB |
ok |
25 |
Correct |
1 ms |
4956 KB |
ok |
26 |
Correct |
1 ms |
4956 KB |
ok |
27 |
Correct |
1 ms |
5052 KB |
ok |
28 |
Correct |
1 ms |
4956 KB |
ok |
29 |
Correct |
2 ms |
4956 KB |
ok |
30 |
Correct |
26 ms |
5080 KB |
ok |
31 |
Correct |
27 ms |
5080 KB |
ok |
32 |
Correct |
26 ms |
4952 KB |
ok |
33 |
Correct |
29 ms |
4956 KB |
ok |
34 |
Correct |
26 ms |
4956 KB |
ok |
35 |
Correct |
26 ms |
4956 KB |
ok |
36 |
Correct |
26 ms |
4952 KB |
ok |
37 |
Correct |
28 ms |
4956 KB |
ok |
38 |
Correct |
28 ms |
4952 KB |
ok |
39 |
Correct |
26 ms |
4956 KB |
ok |
40 |
Correct |
30 ms |
4956 KB |
ok |
41 |
Correct |
28 ms |
5088 KB |
ok |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
2 |
Correct |
1 ms |
4956 KB |
ok |
3 |
Correct |
1 ms |
4956 KB |
ok |
4 |
Correct |
2 ms |
4956 KB |
ok |
5 |
Correct |
1 ms |
4956 KB |
ok |
6 |
Correct |
1 ms |
4952 KB |
ok |
7 |
Correct |
1 ms |
4952 KB |
ok |
8 |
Correct |
1 ms |
4956 KB |
ok |
9 |
Correct |
1 ms |
4956 KB |
ok |
10 |
Correct |
2 ms |
5048 KB |
ok |
11 |
Correct |
1 ms |
4952 KB |
ok |
12 |
Correct |
1 ms |
5080 KB |
ok |
13 |
Correct |
1 ms |
4956 KB |
ok |
14 |
Correct |
2 ms |
5212 KB |
ok |
15 |
Correct |
1 ms |
4956 KB |
ok |
16 |
Correct |
1 ms |
4956 KB |
ok |
17 |
Correct |
3 ms |
4956 KB |
ok |
18 |
Correct |
1 ms |
4956 KB |
ok |
19 |
Correct |
1 ms |
4956 KB |
ok |
20 |
Correct |
1 ms |
4956 KB |
ok |
21 |
Correct |
1 ms |
4956 KB |
ok |
22 |
Correct |
1 ms |
5056 KB |
ok |
23 |
Correct |
1 ms |
4956 KB |
ok |
24 |
Correct |
1 ms |
4952 KB |
ok |
25 |
Correct |
1 ms |
4956 KB |
ok |
26 |
Correct |
1 ms |
4956 KB |
ok |
27 |
Correct |
1 ms |
5052 KB |
ok |
28 |
Correct |
1 ms |
4956 KB |
ok |
29 |
Correct |
2 ms |
4956 KB |
ok |
30 |
Correct |
26 ms |
5080 KB |
ok |
31 |
Correct |
27 ms |
5080 KB |
ok |
32 |
Correct |
26 ms |
4952 KB |
ok |
33 |
Correct |
29 ms |
4956 KB |
ok |
34 |
Correct |
26 ms |
4956 KB |
ok |
35 |
Correct |
26 ms |
4956 KB |
ok |
36 |
Correct |
26 ms |
4952 KB |
ok |
37 |
Correct |
28 ms |
4956 KB |
ok |
38 |
Correct |
28 ms |
4952 KB |
ok |
39 |
Correct |
26 ms |
4956 KB |
ok |
40 |
Correct |
30 ms |
4956 KB |
ok |
41 |
Correct |
28 ms |
5088 KB |
ok |
42 |
Runtime error |
18 ms |
14356 KB |
Execution killed with signal 11 |
43 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
4956 KB |
ok |
2 |
Correct |
1 ms |
4956 KB |
ok |
3 |
Correct |
1 ms |
4956 KB |
ok |
4 |
Correct |
2 ms |
4956 KB |
ok |
5 |
Correct |
1 ms |
4956 KB |
ok |
6 |
Correct |
1 ms |
4956 KB |
ok |
7 |
Correct |
2 ms |
4956 KB |
ok |
8 |
Runtime error |
5 ms |
10076 KB |
Execution killed with signal 11 |
9 |
Halted |
0 ms |
0 KB |
- |