摘要:
posted on 2021-03-01 18:05:25 | under 题解 | source 此题正解是记忆化搜索,我们先考虑暴力 dfs。 显然,我们可以在 $\operatorname{dfs}$ 中传 $3$ 个参数:$x,y,cnt$,分别表示当前的位置和滑雪路径的长度。每次更新答案, 阅读全文
摘要:
posted on 2021-07-10 20:33:18 | under 题解 | [source](https://www.luogu.com.cn/blog/_post/348063) 非常经典的求逆序对个数问题。An inversion is a pair of indices $(i,j) 阅读全文
该文被密码保护。 阅读全文
该文被密码保护。 阅读全文
摘要:
posted on 2022-10-30 11:39:14 | under 题解 | source problem 一个 $n$ 个点 $m$ 条边的有向图,$q$ 次操作: 删除一条边,保证存在; 增加一条边,保证不存在; 删除一个点的所有入边; 将一个点曾经有的入边全部恢复。 每次操作后判断: 阅读全文
摘要:
posted on 2022-10-30 20:49:17 | under 题解 | source problem 长度为 $n$ 的数组 $a$,长度为 $m$ 的数组 $b$。$q$ 次博弈,每次博弈给出 $[l_1,r_1],[l_2,r_2]$,Alice 可以选择一个 $i\in[l_1, 阅读全文
摘要:
posted on 2022-10-29 23:32:15 | under 题解 | source problem $n$ 个点 $m$ 条边的无向无权图,令 $to(i,j)=[\operatorname{dist}(i,j)\leq k+1]$,点带权 $a_i$,求: $$[*]=\max_{ 阅读全文
摘要:
posted on 2021-10-23 22:52:47 | under 题解 | source 分类讨论。 一句话题意:求 $\max\limits_{i=l}^{r}{i\bmod n}$ 首先画个数轴,按除以 $n$ 向下取整的商把这些整数分块,大概是这样: 容易看出每块中的整数 $\bmo 阅读全文