#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
const int mxN = (int)1e3+10;
int n;
set<int> col[mxN];
int biggest_stadium(int N, vector<vector<int>> F)
{
n = N; int ans = 0;
vector<vector<int>> xd;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
xd[i].pb(0);
if(!F[i][j]) continue;
col[j].insert(i);
}
col[i].insert(-1),col[i].insert(n);
}
for(int _ = 0; _ < 4; _++){
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
for(int k = i; k < n; k++){
if(F[k][j]) break;
for(int l = i; l <= k; l++){
int U = i, D = k;
int tot = D-U+1;
for(int m = j-1; m>=0; m--){
if(F[l][m]) break;
auto itr2 = col[m].lower_bound(l);
auto itr = itr2; itr--;
U = max(U,*itr+1);
D = min(D,*itr2-1);
tot+=D-U+1;
}
U = i, D = k;
for(int m = j+1; m < n; m++){
if(F[l][m]) break;
auto itr2 = col[m].lower_bound(l);
auto itr = itr2; itr--;
U = max(U,*itr+1);
D = min(D,*itr2-1);
tot+=D-U+1;
}
ans = max(ans, tot);
}
}
}
}
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
xd[j][i] = F[i][j];
for(int i = 0; i < n; i++)
for(int j = 0; j <= n/2; j++)
F[i][j] = xd[i][n-j];
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |