# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
319976 | jamezzz | Furniture (JOI20_furniture) | C++14 | 462 ms | 13028 KiB |
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 <bits/stdc++.h>
using namespace std;
int n, m, q, x, y, c[2005];
bool r[1005][1005];
void dfs(int x, int y);
void push(int x, int y){
if (r[x][y]){
r[x][y] = false;
--c[x + y];
dfs(x, y);
}
}
int add(int x, int y){
if (!r[x][y]) return 1; //no path through (x, y)
if (c[x + y] == 1) return 0;
push(x, y);
return 1;
}
void dfs(int x, int y){
if (!r[x - 1][y + 1]){
push(x - 1, y);
push(x, y + 1);
}
if (!r[x + 1][y - 1]){
push(x, y - 1);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |