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;
int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
int tot = 0;
for (int i = 0; i < N; i++){
for (int j = 0; j < N; j++) {
if (!F[i][j]) tot++;
}
}
vector<int> lc(N, -1); // -1 non ancora vuota, 0 vuota, 1 ritrovata piena
for (int i = 0; i < N; i++){
for (int j = 0; j < N; j++) {
if (!F[i][j]) {
if (lc[j] == 0) continue;
lc[j]++;
if (lc[j] == 2) return tot+1;
}
else if (lc[j] == 0) lc[j]++;
}
}
fill(lc.begin(), lc.end(), -1);
for (int i = 0; i < N; i++){
for (int j = 0; j < N; j++) {
if (!F[j][i]) {
if (lc[j] == 0) continue;
lc[j]++;
if (lc[j] == 2) return tot+1;
}
else if (lc[j] == 0) lc[j]++;
}
}
return tot;
}
# | 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... |