# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1078289 | 2024-08-27T14:54:52 Z | PanosPask | Soccer Stadium (IOI23_soccer) | C++17 | 1 ms | 348 KB |
#include "soccer.h" using namespace std; vector<vector<int>> grid; vector<bool> empty_row; vector<vector<int>> rotated; vector<bool> empty_column; bool check_row(vector<int>& r, vector<bool>& place, int pos) { bool started = false; bool ended = false; for (int i = 0; i < r.size(); i++) { if (r[i] == 0) { if (ended) { return false; } if (!started) { started = true; } } else { if (started) { ended = true; } } } place[pos] = started; return true; } int biggest_stadium(int N, std::vector<std::vector<int>> F) { grid.resize(N, vector<int>(N)); rotated.resize(N, vector<int>(N)); empty_column.resize(N); empty_row.resize(N); int tot = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { grid[i][j] = F[i][j]; rotated[j][i] = F[i][j]; tot += !F[i][j]; } } bool good = true; for (int i = 0; i < N; i++) { good = good && check_row(grid[i], empty_row, i) && check_row(rotated[i], empty_column, i); } if (!good) { return 0; } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (empty_row[i] && empty_column[j]) { if (F[i][j] && F[j][i]) { return 0; } } } } return tot; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 348 KB | partial |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 348 KB | partial |
2 | Incorrect | 1 ms | 348 KB | wrong |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 348 KB | partial |
2 | Incorrect | 1 ms | 348 KB | wrong |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 348 KB | partial |
2 | Incorrect | 1 ms | 348 KB | wrong |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 348 KB | partial |
2 | Incorrect | 1 ms | 348 KB | wrong |
3 | Halted | 0 ms | 0 KB | - |