# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
292789 | b00n0rp | Furniture (JOI20_furniture) | C++17 | 535 ms | 41836 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.
/*
Soln:
Keep track of up/down/lft/rgt[i][j].
up[i][j] stores whether there is a path from 1,1 to i-1,j to i,j
and the rest can be defined so as well
If we know for a fact that blocking i,j won't block the path we can just recursively change
up/down/lft/rgt[i][j].
This will be O(nm) over all queries
To check whether blocking i,j will block the path we can run a O(n+m) loop per query
or we can use segtrees/BITs to make it O(log(n)+log(m)) per query
Test cases are weak so O((n+m)) per query or O(nm*(n+m)) in total also works
*/
// --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
*/
// -------------------</optimizations>--------------------
// ---------------<Headers and namespaces>----------------
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |