# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
288285 | rama_pang | Abduction 2 (JOI17_abduction2) | C++14 | 656 ms | 5372 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;
// Speed up looking next line change with sparse table,
// and memoize based on [left_end, right_end] of each
// street. State is O(H + W), since for every line x and
// the section we enter it, and from that line we go left
// or right to change to another line y and z, then if we
// change the path and instead goes through a line that passes
// through y and z, we will never stop at x. Thus for each
// line only one "region" matters.
// Time: O(Q * (H + W))
using lint = long long;
const int MAXN = 100005;
int H, W, Q;
array<int, 3> A[MAXN];
int st[MAXN];
int et[MAXN];
lint dpl[MAXN];
lint dpr[MAXN];
int revpos[MAXN][2];
lint Solve(int X, int Y, int mask) {
lint res = 0;
int xl = 0, xr = H - 1;
int yl = 0, yr = W - 1;
memset(dpl, 0, sizeof(dpl));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |