Submission #928115

#TimeUsernameProblemLanguageResultExecution timeMemory
928115aykhnSoccer Stadium (IOI23_soccer)C++17
0 / 100
4562 ms2908 KiB
#include <bits/stdc++.h> #include "soccer.h" using namespace std; int biggest_stadium(int n, vector<vector<int>> A) { int res = 0; for (int x = 0; x < n; x++) { for (int y = 0; y < n; y++) { if (A[x][y]) continue; int l1, r1, l2, r2; for (int k = y; k >= 0; k--) { if (A[x][k]) break; l1 = l2 = k; } for (int k = y; k < n; k++) { if (A[x][k]) break; r1 = r2 = k; } int c = 0; for (int i = x; i >= 0; i--) { if (A[i][y]) break; for (int j = y; j >= l1; j--) { if (A[i][j]) { l1 = j + 1; break; } c++; } for (int j = y + 1; j <= r1; j++) { if (A[i][j]) { r1 = j - 1; break; } c++; } } for (int i = x + 1; i < n; i++) { if (A[i][y]) break; for (int j = y; j >= l2; j--) { if (A[i][j]) { l2 = j + 1; break; } c++; } for (int j = y + 1; j <= r2; j++) { if (A[i][j]) { r2 = j - 1; break; } c++; } } res = max(res, c); } } return res; }
#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...