#include <bits/stdc++.h>
#include "soccer.h"
using namespace std;
const int nx[4] = {0, 0, 1, -1}, ny[4] = {1, -1, 0, 0};
int biggest_stadium(int N, vector<vector<int>> F) {
int res = 0;
for(int l = 0; l < N; l++) {
for(int i = 0; i < N; i++) {
if(F[l][i] == 1) continue;
int cur = 0;
queue<pair<int, int>> Q;
Q.push({l,i});
while(!Q.empty()) {
int X = Q.front().first, Y = Q.front().second; Q.pop();
if(F[X][Y]) continue;
++cur; F[X][Y] = 1;
for(int l = 0; l < 4; l++) {
int x = X + nx[l], y = Y + ny[l];
if(x == N || x < 0 || y == N || y < 0) continue;
if(F[x][y]) continue;
Q.push({x, y});
}
}
res = max(res, cur);
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
ok |
2 |
Correct |
1 ms |
348 KB |
ok |
3 |
Correct |
1 ms |
348 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Incorrect |
0 ms |
344 KB |
wrong |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
ok |
2 |
Correct |
1 ms |
348 KB |
ok |
3 |
Incorrect |
1 ms |
348 KB |
wrong |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong |
2 |
Halted |
0 ms |
0 KB |
- |