# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
316926 | manh9203 | Furniture (JOI20_furniture) | C++17 | 452 ms | 24016 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;
using ll = long long;
const int N = 1005;
int n, m, q;
int a[N][N];
int dp[N][N][2], cntGood[2 * N];
bool check1(int x, int y) {
if (dp[x][y][0] == 1 && dp[x - 1][y][0] == 0 && dp[x][y - 1][0] == 0) {
return 1;
} else {
return 0;
}
}
void dfs1(int x, int y) {
if ((dp[x][y][0] & dp[x][y][1]) == 1) cntGood[x + y]--;
dp[x][y][0] = 0;
if (x + 1 <= n && check1(x + 1, y)) dfs1(x + 1, y);
if (y + 1 <= m && check1(x, y + 1)) dfs1(x, y + 1);
}
bool check2(int x, int y) {
if (dp[x][y][1] == 1 && dp[x + 1][y][1] == 0 && dp[x][y + 1][1] == 0) {
return 1;
} else {
return 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |