| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1327756 | SpyrosAliv | Soccer Stadium (IOI23_soccer) | C++20 | 0 ms | 332 KiB |
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
int n, tot;
vector<vector<int>> grid;
vector<vector<bool>> vis;
void flood(int i, int j) {
if (i < 0 || i >= n || j < 0 || j >= n || vis[i][j] || grid[i][j]) return;
tot++;
vis[i][j] = true;
flood(i-1, j);
flood(i+1, j);
flood(i, j+1);
flood(i, j-1);
}
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
n = N;
grid = F;
vis.assign(n, vector<bool>(n, false));
if (n == 1) return 1;
int tot = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
tot += grid[i][j];
}
}
if (tot == 0) return n * n;
int ans = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
tot = 0;
flood(i, j);
ans = max(ans, tot);
}
}
return ans;
}
| # | 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... | ||||
