#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
int biggest_stadium(int N,vector<vector<int>> F){
vector DP(N,vector(N,vector(N,vector(N,vector(N,vector(N,0))))));
for(int row1=N-1;row1>=0;row1--){
for(int row2=row1;row2<N;row2++){
for(int col1=0;col1<N;col1++){
for(int col2=col1;col2<N;col2++){
if(F[row1][col2])break;
for(int col3=0;col3<N;col3++){
for(int col4=col3;col4<N;col4++){
if(F[row2][col4])break;
if(!(col3<=col1 and col2<=col4) and !(col1<=col3 and col4<=col2))continue;
if(row1==row2) {
DP[row1][row2][col1][col2][col3][col4]=max(col2,col4)-min(col1,col3)+1;
continue;
}
if(row1+1==row2) {
DP[row1][row2][col1][col2][col3][col4]=col2+col4-col1-col3+2;
continue;
}
for(int col5=0;col5<=col1;col5++) {
for(int col6=col2;col6<N;col6++) {
DP[row1][row2][col1][col2][col3][col4]=max(DP[row1][row2][col1][col2][col3][col4],DP[row1+1][row2][col5][col6][col3][col4]+col2-col1+1);
}
}
}
}
}
}
}
}
int ans = 0;
for(auto&i:DP) {
for(auto&j:i) {
for(auto&k:j) {
for(auto&l:k) {
for(auto&h:l) {
for(auto&o:h) {
ans = max(ans,o);
}
}
}
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
600 KB |
ok |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
5 ms |
5300 KB |
ok |
4 |
Correct |
11 ms |
8536 KB |
ok |
5 |
Correct |
1 ms |
436 KB |
ok |
6 |
Correct |
0 ms |
432 KB |
ok |
7 |
Runtime error |
926 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
600 KB |
ok |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Partially correct |
0 ms |
348 KB |
partial |
4 |
Partially correct |
0 ms |
436 KB |
partial |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Correct |
0 ms |
348 KB |
ok |
7 |
Correct |
1 ms |
348 KB |
ok |
8 |
Correct |
0 ms |
348 KB |
ok |
9 |
Correct |
0 ms |
348 KB |
ok |
10 |
Partially correct |
0 ms |
348 KB |
partial |
11 |
Correct |
0 ms |
348 KB |
ok |
12 |
Correct |
1 ms |
348 KB |
ok |
13 |
Correct |
0 ms |
348 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
ok |
2 |
Correct |
0 ms |
600 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Partially correct |
0 ms |
348 KB |
partial |
5 |
Partially correct |
0 ms |
436 KB |
partial |
6 |
Correct |
0 ms |
348 KB |
ok |
7 |
Correct |
0 ms |
348 KB |
ok |
8 |
Correct |
1 ms |
348 KB |
ok |
9 |
Correct |
0 ms |
348 KB |
ok |
10 |
Correct |
0 ms |
348 KB |
ok |
11 |
Partially correct |
0 ms |
348 KB |
partial |
12 |
Correct |
0 ms |
348 KB |
ok |
13 |
Correct |
1 ms |
348 KB |
ok |
14 |
Correct |
0 ms |
348 KB |
ok |
15 |
Partially correct |
2 ms |
1884 KB |
partial |
16 |
Partially correct |
2 ms |
1880 KB |
partial |
17 |
Partially correct |
3 ms |
1884 KB |
partial |
18 |
Correct |
2 ms |
1884 KB |
ok |
19 |
Correct |
2 ms |
1884 KB |
ok |
20 |
Incorrect |
2 ms |
1884 KB |
wrong |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
ok |
2 |
Correct |
0 ms |
600 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
5 ms |
5300 KB |
ok |
5 |
Correct |
11 ms |
8536 KB |
ok |
6 |
Partially correct |
0 ms |
348 KB |
partial |
7 |
Partially correct |
0 ms |
436 KB |
partial |
8 |
Correct |
0 ms |
348 KB |
ok |
9 |
Correct |
0 ms |
348 KB |
ok |
10 |
Correct |
1 ms |
348 KB |
ok |
11 |
Correct |
0 ms |
348 KB |
ok |
12 |
Correct |
0 ms |
348 KB |
ok |
13 |
Partially correct |
0 ms |
348 KB |
partial |
14 |
Correct |
0 ms |
348 KB |
ok |
15 |
Correct |
1 ms |
348 KB |
ok |
16 |
Correct |
0 ms |
348 KB |
ok |
17 |
Partially correct |
2 ms |
1884 KB |
partial |
18 |
Partially correct |
2 ms |
1880 KB |
partial |
19 |
Partially correct |
3 ms |
1884 KB |
partial |
20 |
Correct |
2 ms |
1884 KB |
ok |
21 |
Correct |
2 ms |
1884 KB |
ok |
22 |
Incorrect |
2 ms |
1884 KB |
wrong |
23 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
ok |
2 |
Correct |
0 ms |
600 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
5 ms |
5300 KB |
ok |
5 |
Correct |
11 ms |
8536 KB |
ok |
6 |
Partially correct |
0 ms |
348 KB |
partial |
7 |
Partially correct |
0 ms |
436 KB |
partial |
8 |
Correct |
0 ms |
348 KB |
ok |
9 |
Correct |
0 ms |
348 KB |
ok |
10 |
Correct |
1 ms |
348 KB |
ok |
11 |
Correct |
0 ms |
348 KB |
ok |
12 |
Correct |
0 ms |
348 KB |
ok |
13 |
Partially correct |
0 ms |
348 KB |
partial |
14 |
Correct |
0 ms |
348 KB |
ok |
15 |
Correct |
1 ms |
348 KB |
ok |
16 |
Correct |
0 ms |
348 KB |
ok |
17 |
Partially correct |
2 ms |
1884 KB |
partial |
18 |
Partially correct |
2 ms |
1880 KB |
partial |
19 |
Partially correct |
3 ms |
1884 KB |
partial |
20 |
Correct |
2 ms |
1884 KB |
ok |
21 |
Correct |
2 ms |
1884 KB |
ok |
22 |
Incorrect |
2 ms |
1884 KB |
wrong |
23 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
ok |
2 |
Correct |
0 ms |
600 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
5 ms |
5300 KB |
ok |
5 |
Correct |
11 ms |
8536 KB |
ok |
6 |
Correct |
1 ms |
436 KB |
ok |
7 |
Correct |
0 ms |
432 KB |
ok |
8 |
Runtime error |
926 ms |
2097152 KB |
Execution killed with signal 9 |
9 |
Halted |
0 ms |
0 KB |
- |