This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "soccer.h"
#include "bits/stdc++.h"
using namespace std;
using i32 = int;
#define int long long
#define len(x) (int)(x.size())
#define all(x) x.begin(), x.end()
#define inf 1000'000'000'000'000'000LL
#define bit(x, i) (((x) >> i) & 1)
template<typename T>
using vec = vector<T>;
i32 biggest_stadium(i32 n, std::vector<std::vector<i32>> F) {
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cnt += F[i][j] == 0;
}
}
vec<vec<bool>> used(n, vec<bool>(n, false));
for (int i = 1; i < n; i++) {
for (int j = 0; j < n; j++) {
if (used[i][j]) continue;
if (!F[i][j]) continue;
if (F[i - 1][j] == 0) {
for (int k = i; k < n; k++) {
if (F[k][j] == 0) return 0;
used[k][j] = true;
}
}
}
}
used = vec<vec<bool>>(n, vec<bool>(n, false));
for (int i = 0; i < n; i++) {
for (int j = 1; j < n; j++) {
if (used[i][j]) continue;
if (!F[i][j]) continue;
if (F[i][j - 1] == 0) {
for (int k = j; k < n; k++) {
if (F[i][k] == 0) return 0;
used[i][k] = true;
}
}
}
}
return cnt;
}
# | 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... |