# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1156854 | fryingduc | Furniture (JOI20_furniture) | C++20 | 1 ms | 324 KiB |
#include "bits/stdc++.h"
using namespace std;
#ifdef duc_debug
#include "bits/debug.h"
#else
#define debug(...)
#endif
const int maxn = 1e3 + 3;
const int Q = 1e6 + 6;
int n, m, q;
bool a[maxn][maxn];
bool vis[maxn][maxn];
int diag[maxn * 2];
void del(int x, int y) {
queue<pair<int, int>> qu;
qu.push(make_pair(x, y));
a[x][y] = 1;
--diag[x + y];
while (!qu.empty()) {
int x = qu.front().first, y = qu.front().second;
qu.pop();
int r = x + 1, c = y;
if (r >= 1 and r <= n and !a[r][c]) {
if (a[r - 1][c] and a[r][c - 1]) {
a[r][c] = 1;
--diag[r + c];
qu.push(make_pair(r, c));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |