Submission #288285

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2882852020-09-01 11:36:32rama_pangAbduction 2 (JOI17_abduction2)C++14
100 / 100
656 ms5372 KiB
#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));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...