이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |