# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
936391 | OAleksa | Furniture (JOI20_furniture) | C++14 | 269 ms | 30920 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 f first
#define s second
#define int long long
const int N = 1069;
int n, m, a[N][N], dp1[N][N], dp2[N][N];
int g[N][N], cnt[2 * N];
void Go(int x, int y) {
g[x][y] = 1;
cnt[x + y]--;
if (g[x + 1][y - 1]) {
if (!g[x][y - 1])
Go(x, y - 1);
if (!g[x + 1][y])
Go(x + 1, y);
}
if (g[x - 1][y + 1]) {
if (!g[x - 1][y])
Go(x - 1, y);
if (!g[x][y + 1])
Go(x, y + 1);
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt = 1;
//cin >> tt;
while (tt--) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |