Submission #1066447

# Submission time Handle Problem Language Result Execution time Memory
1066447 2024-08-19T21:57:42 Z aaaaaarroz Soccer Stadium (IOI23_soccer) C++17
0 / 100
0 ms 348 KB
#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
1 Partially correct 0 ms 348 KB partial
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 348 KB partial
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -