Submission #1066447

#TimeUsernameProblemLanguageResultExecution timeMemory
1066447aaaaaarrozSoccer Stadium (IOI23_soccer)C++17
0 / 100
0 ms348 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...