#include "soccer.h"
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
#define pb push_back
ll b[2010][2010];
ll mx = 0;
vector<vector<int> > O, X;
ll cek(int N, std::vector<std::vector<int>> F)
{
ll sum = 0;
for(ll i = 0; i < N; i++)
{
for(ll j = 0; j < N; j++)
{
// cout << F[i][j];
sum += (1 - F[i][j]);
}
// cout << "\n";
}
// cout << "\n";
ll te = 0;
for(ll i = 0; i < N; i++)
for(ll j = 0; j < N; j++)
{
if(F[i][j])continue;
ll ha = 0;
te++;
for(ll k = i; k < N; k++)
{
if(F[k][j])break;
for(ll l = j; l < N; l++)
{
if(F[k][l])break;
ha += (b[k][l] != te);
b[k][l] = te;
}
for(ll l = j; l >= 0; l--)
{
if(F[k][l])break;
ha += (b[k][l] != te);
b[k][l] = te;
}
}
// cout << ha << "_\n";
for(ll k = i; k >= 0; k--)
{
if(F[k][j])break;
for(ll l = j; l < N; l++)
{
if(F[k][l])break;
ha += (b[k][l] != te);
b[k][l] = te;
}
for(ll l = j; l >= 0; l--)
{
if(F[k][l])break;
ha += (b[k][l] != te);
b[k][l] = te;
}
}
for(ll k = j; k < N; k++)
{
if(F[i][k])break;
for(ll l = i; l < N; l++)
{
if(F[l][k])break;
ha += (b[l][k] != te);
b[l][k] = te;
}
for(ll l = i; l >= 0; l--)
{
if(F[l][k])break;
ha += (b[l][k] != te);
b[l][k] = te;
}
}
for(ll k = j; k >= 0; k--)
{
if(F[i][k])break;
for(ll l = i; l < N; l++)
{
if(F[l][k])break;
ha += (b[l][k] != te);
b[l][k] = te;
}
for(ll l = i; l >= 0; l--)
{
if(F[l][k])break;
ha += (b[l][k] != te);
b[l][k] = te;
}
}
// cout << ha << "_\n";
if(ha != sum)
return 0;
}
// cout << sum << "_\n";
return sum;
}
void jalan(ll i, ll j, ll N)
{
if(i == N)
{
mx = max(mx, cek(N, X));
return ;
}
ll nI = i;
ll nJ = j + 1;
if(nJ == N)
{
nI++;
nJ = 0;
}
X[i][j] = 1;
jalan(nI, nJ, N);
if(!O[i][j])
{
X[i][j] = 0;
jalan(nI, nJ, N);
}
}
int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
O = F;
X = F;
jalan(0, 0, N);
return mx;
// return cek(N, F);
// for(ll i = 0; i < N; i++)
// for(ll j = 0; j < N; j++)
// {
// if(F[i][j])
// {
// return N * N - min(i + 1, N - i) * min(j + 1, N - j);
// }
// }
// return N * N;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1202 ms |
428 KB |
partial |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1202 ms |
428 KB |
partial |
2 |
Incorrect |
0 ms |
344 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1202 ms |
428 KB |
partial |
2 |
Incorrect |
0 ms |
344 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1202 ms |
428 KB |
partial |
2 |
Incorrect |
0 ms |
344 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1202 ms |
428 KB |
partial |
2 |
Incorrect |
0 ms |
344 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |