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>
#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 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... |