#include "bits/stdc++.h"
#include "soccer.h"
#define FOR(i, begin, end) for(int i=(begin); i<(end); i++)
#define pb push_back
using namespace std;
typedef vector<int> vi;
const int N=2e3+10;
int n, f[N][N], par[N][N];
bool ai[N][N], bi[N][N], aj[N][N], bj[N][N];
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
n=N; FOR(i, 0, n) FOR(j, 0, n) f[i][j]=F[i][j];
FOR(i, 0, n) {
FOR(j, 0, n) {
if(j==0) {
if(f[i][j]) aj[i][j]=true;
continue;
}
aj[i][j]=aj[i][j-1]&f[i][j];
}
for(int j=n-1; j>=0; j--) {
if(j==n-1) {
if(f[i][j]) bj[i][j]=true;
continue;
}
bj[i][j]=bj[i][j+1]&f[i][j];
}
}
FOR(j, 0, n) {
FOR(i, 0, n) {
if(i==0) {
if(f[i][j]) ai[i][j]=true;
continue;
}
ai[i][j]=ai[i-1][j]&f[i][j];
}
for(int i=n-1; i>=0; i--) {
if(i==n-1) {
if(f[i][j]) bi[i][j]=true;
continue;
}
bi[i][j]=bi[i+1][j]&f[i][j];
}
}
int cn=0;
FOR(i, 0, n) {
FOR(j, 0, n) {
if(f[i][j]) {
bool ok=false;
ok|=ai[i][j]&aj[i][j];
ok|=bi[i][j]&aj[i][j];
ok|=ai[i][j]&bj[i][j];
ok|=bi[i][j]&bj[i][j];
if(!ok) return 0;
}
else cn++;
}
}
return cn;
}
/*
5
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
1 1 0 0 0
0 0
0 0
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
348 KB |
partial |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
ok |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
1 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Partially correct |
1 ms |
348 KB |
partial |
7 |
Partially correct |
2 ms |
1624 KB |
partial |
8 |
Partially correct |
23 ms |
9672 KB |
partial |
9 |
Partially correct |
336 ms |
71136 KB |
partial |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
ok |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Partially correct |
0 ms |
348 KB |
partial |
4 |
Partially correct |
0 ms |
348 KB |
partial |
5 |
Incorrect |
0 ms |
344 KB |
wrong |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Partially correct |
0 ms |
348 KB |
partial |
5 |
Partially correct |
0 ms |
348 KB |
partial |
6 |
Incorrect |
0 ms |
344 KB |
wrong |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
1 ms |
348 KB |
ok |
6 |
Partially correct |
0 ms |
348 KB |
partial |
7 |
Partially correct |
0 ms |
348 KB |
partial |
8 |
Incorrect |
0 ms |
344 KB |
wrong |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
1 ms |
348 KB |
ok |
6 |
Partially correct |
0 ms |
348 KB |
partial |
7 |
Partially correct |
0 ms |
348 KB |
partial |
8 |
Incorrect |
0 ms |
344 KB |
wrong |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
1 ms |
348 KB |
ok |
6 |
Correct |
0 ms |
348 KB |
ok |
7 |
Partially correct |
1 ms |
348 KB |
partial |
8 |
Partially correct |
2 ms |
1624 KB |
partial |
9 |
Partially correct |
23 ms |
9672 KB |
partial |
10 |
Partially correct |
336 ms |
71136 KB |
partial |
11 |
Partially correct |
0 ms |
348 KB |
partial |
12 |
Partially correct |
0 ms |
348 KB |
partial |
13 |
Incorrect |
0 ms |
344 KB |
wrong |
14 |
Halted |
0 ms |
0 KB |
- |