#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
const int N=2005;
int mvx[]={1,0,-1,0},mvy[]={0,1,0,-1},a[N][N],p[N][N];
int biggest_stadium(int n, std::vector<std::vector<int>> F)
{
bool ok=true;
for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) a[i][j]=F[i-1][j-1];
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++){
p[i][j]=p[i-1][j]+p[i][j-1]-p[i-1][j-1]+1-a[i][j];
}
}
for (int i=1;i<=n;i++){
for (int j=1;j<=n;j++){
if (!a[i][j]) continue;
int x=4;
x-=bool(p[i][j]);
x-=bool(p[n][n]-p[i-1][n]-p[n][j-1]+p[i-1][j-1]);
x-=bool(p[n][j]-p[i-1][j]);
x-=bool(p[i][n]-p[i][j-1]);
ok&=(x>0);
}
}return ok;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
2396 KB |
partial |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2396 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2396 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
2396 KB |
partial |
2 |
Incorrect |
0 ms |
2396 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
2396 KB |
partial |
2 |
Incorrect |
0 ms |
2396 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
2396 KB |
partial |
2 |
Incorrect |
0 ms |
2396 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
2396 KB |
partial |
2 |
Incorrect |
0 ms |
2396 KB |
wrong |
3 |
Halted |
0 ms |
0 KB |
- |