# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
296119 | Berted | Furniture (JOI20_furniture) | C++14 | 395 ms | 12260 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 <iostream>
#include <queue>
#define pii pair<int, int>
#define fst first
#define snd second
using namespace std;
const int dir[4][2] = {{0, -1}, {-1, 0}, {0, 1}, {1, 0}};
int n, m, Q, ar[1001][1001];
int cnt[2001];
bool tr[1001][1001], bt[1001][1001];
queue<pii> q;
vector<pii> backtrack;
inline bool inGrid(int y, int x) {return 0 <= y && y < n && 0 <= x && x < m;}
inline void clear()
{
for (auto &x : backtrack) {bt[x.fst][x.snd] = 0;}
backtrack.clear();
}
inline void BFS(int y, int x)
{
q.push({y, x}); backtrack.push_back({y, x});
bt[y][x] = 1; tr[y][x] = 0;
while (q.size())
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |