# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
742533 | josanneo22 | Furniture (JOI20_furniture) | C++17 | 284 ms | 19780 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;
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
const int MN = 1005;
int n, m, q, r, c, a[MN][MN], reach[MN][MN], cnt[MN + MN];
void block(int i, int j) {
reach[i][j] = 0;
cnt[i + j]--;
if (!reach[i + 1][j - 1] && reach[i + 1][j]) block(i + 1, j);
if (!reach[i + 1][j - 1] && reach[i][j - 1]) block(i, j - 1);
if (!reach[i - 1][j + 1] && reach[i - 1][j]) block(i - 1, j);
if (!reach[i - 1][j + 1] && reach[i][j + 1]) block(i, j + 1);
}
void solve() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
reach[i][j] = 1;
cnt[i + j]++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |