Submission #316926

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3169262020-10-28 15:35:11manh9203Furniture (JOI20_furniture)C++17
100 / 100
452 ms24016 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...