# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1056670 | Triseedot | 축구 경기장 (IOI23_soccer) | C++17 | 228 ms | 47644 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <debug.h>
#else
#define debug(...) 42
#endif
using ll = long long;
#define all(v) v.begin(), v.end()
#define len(v) int(v.size())
const ll INF = 1e18;
int biggest_stadium(int N, vector<vector<int>> F) {
vector<int> row_first(N, -1), row_last(N, -1), col_first(N, -1), col_last(N, -1);
int cnt = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (!F[i][j]) {
cnt++;
if (row_last[i] != -1 && row_last[i] != j - 1) {
return 0;
}
row_last[i] = j;
if (row_first[i] == -1) row_first[i] = j;
}
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (!F[j][i]) {
if (col_last[i] != -1 && col_last[i] != j - 1) {
return 0;
}
col_last[i] = j;
if (col_first[i] == -1) col_first[i] = j;
}
}
}
vector pref_sum(N + 1, vector(N + 1, 0));
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
pref_sum[i + 1][j + 1] = pref_sum[i][j + 1] + pref_sum[i + 1][j] - pref_sum[i][j] + 1 - F[i][j];
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (!F[i][j]) {
debug(i, j);
if (pref_sum[col_first[j]][row_first[i]] > 0) {
return 0;
}
if (pref_sum[col_first[j]][N] - pref_sum[col_first[j]][row_last[i] + 1] > 0) {
debug(i, j);
return 0;
}
}
}
}
return cnt;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |