# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
292789 | b00n0rp | Furniture (JOI20_furniture) | C++17 | 535 ms | 41836 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
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... |