# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
378376 | qwerty234 | Furniture (JOI20_furniture) | C++14 | 670 ms | 27780 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
const int MAXN = 1e3 + 10, inf = 2e9;
int n, m, q, a[MAXN][MAXN], b[MAXN][MAXN], c[MAXN][MAXN], dia[MAXN][MAXN], cnt[2 * MAXN];
void dfs1(int i, int j) {
if (i < 1 || n < i || j < 1 || m < j || b[i][j] == 0)
return;
b[i][j] = (b[i - 1][j] | b[i][j - 1]);
if (b[i][j] == 0) cnt[dia[i][j]] -= (b[i][j] | c[i][j]), dfs1(i + 1, j), dfs1(i, j + 1);
}
void dfs2(int i, int j) {
if (i < 1 || n < i || j < 1 || m < j || c[i][j] == 0)
return;
c[i][j] = (c[i + 1][j] | c[i][j + 1]);
if (c[i][j] == 0) cnt[dia[i][j]] -= (b[i][j] | c[i][j]), dfs2(i - 1, j), dfs2(i, j - 1);
}
void add(int i, int j) {
cnt[dia[i][j]] -= (b[i][j] & c[i][j]);
b[i][j] = c[i][j] = 0;
dfs1(i + 1, j); dfs1(i, j + 1);
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |