This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int biggest_stadium(int N, vector<vector<int>> F) {
// Matriz que guarda el tamaño de la mayor cancha válida que termina en (r, c)
vector<vector<int>> maxCol(N, vector<int>(N, 0));
// Inicializar el mapa de segmentos válidos
for (int r = 0; r < N; r++) {
for (int c = 0; c < N; c++) {
if (F[r][c] == 0) {
maxCol[r][c] = (c == 0) ? 1 : maxCol[r][c-1] + 1;
}
}
}
int best = 0;
// Buscar la cancha regular más grande
for (int c = 0; c < N; c++) {
for (int r = 0; r < N; r++) {
int width = INT_MAX;
for (int k = r; k < N; k++) {
if (F[k][c] == 1) break;
width = min(width, maxCol[k][c]);
int height = k - r + 1;
int area = width * height;
best = max(best, area);
}
}
}
return best;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |