随笔分类 -  dp

摘要:洛谷传送门 CF 传送门 首先转化一下,让鸭子不动,猎人往右移动,就相当于开的相邻两枪距离 \(> m\)。 设 \(f_{x, i}\) 为仅考虑 \(r \le x\) 的鸭子,上一次在 \(i\) 开枪,能打到的最大鸭子个数。 \(f_{x - 1} \to f_x\) 时,首先有 \(f_{ 阅读全文
posted @ 2023-09-11 20:06 zltzlt 阅读(50) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P9528 "洛谷传送门") [LOJ 传送门](https://loj.ac/p/3693 "LOJ 传送门") [UOJ 传送门](https://uoj.ac/problem/730 "UOJ 传送门") 神题。 阅读全文
posted @ 2023-09-08 12:41 zltzlt 阅读(101) 评论(1) 推荐(1)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc041_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc041/tasks/agc041_f "AtCoder 传送门") 神题!!!!!!! 阅读全文
posted @ 2023-09-07 21:49 zltzlt 阅读(38) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1860D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1860/D "CF 传送门") 首先考虑一个子问题,给两个只含有 $0$ 和 $ 阅读全文
posted @ 2023-08-19 07:23 zltzlt 阅读(111) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_cf17_final_j "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/cf17-final/tasks/cf17_final_j "AtCoder 传送门 阅读全文
posted @ 2023-08-03 23:08 zltzlt 阅读(61) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF888F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/888/F "CF 传送门") 做做简单题放松身心。 考虑区间 dp,设 $f_{i 阅读全文
posted @ 2023-07-31 23:30 zltzlt 阅读(32) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1268E "洛谷传送门") [AtCoder 传送门](https://codeforces.com/problemset/problem/1268/E "AtCoder 传送门") 考虑一些简单的情况,比如树。 阅读全文
posted @ 2023-07-28 08:32 zltzlt 阅读(46) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc040_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc040/tasks/agc040_e "AtCoder 传送门") 比较神奇的题。 考 阅读全文
posted @ 2023-07-24 16:29 zltzlt 阅读(25) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1810G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1810/G "CF 传送门") 感觉是比较 educational 的题。 拿到 阅读全文
posted @ 2023-07-24 15:31 zltzlt 阅读(112) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P8490 "洛谷传送门") [LOJ 传送门](https://loj.ac/p/3830 "LOJ 传送门") 不算很难的题,但是调起来比较恶心。 下文默认下标从 $1$ 开始。 设第 $i$ 列长堤的高度为 $h 阅读全文
posted @ 2023-07-22 19:38 zltzlt 阅读(123) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc049_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc049/tasks/agc049_e "AtCoder 传送门") 好题。同时考查了 阅读全文
posted @ 2023-07-19 21:30 zltzlt 阅读(54) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc032_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc032/tasks/agc032_d "AtCoder 传送门") 设 $b_i$ 为 阅读全文
posted @ 2023-07-18 10:17 zltzlt 阅读(21) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P4931 "洛谷传送门") 设 $f_i$ 为 $i$ 对情侣完全错位的方案数,那么答案为: $$\binom{n}{k} \frac{n!}{(n - k)!} 2^k f_{n - k}$$ 分别代表选择 $k$ 阅读全文
posted @ 2023-07-15 12:47 zltzlt 阅读(40) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc164_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc164/tasks/arc164_e "AtCoder 传送门") 妙妙题。 我们考虑 阅读全文
posted @ 2023-07-11 21:56 zltzlt 阅读(78) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc309_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc309/tasks/abc309_g "AtCoder 传送门") 前置知识:[[AR 阅读全文
posted @ 2023-07-11 20:21 zltzlt 阅读(64) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1525F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1525/F "CF 传送门") 套路地,将 DAG 的最小不交路径覆盖转化为点数 阅读全文
posted @ 2023-07-11 17:01 zltzlt 阅读(40) 评论(0) 推荐(0)
摘要:[UOJ 传送门](https://uoj.ac/problem/37 "UOJ 传送门") 考虑 dp。设 $f_S$ 为点集 $S$ 构成强连通分量的方案数。 容易想到容斥。设 $ed_S$ 为 $S$ 内部连边数,那么 $f_S$ 就是总的方案数 $2^{ed_S}$ 减去构成的不是强连通分量 阅读全文
posted @ 2023-07-10 11:48 zltzlt 阅读(616) 评论(0) 推荐(6)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_keyence2021_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/keyence2021/tasks/keyence2021_e "AtCoder 阅读全文
posted @ 2023-07-06 16:18 zltzlt 阅读(25) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc033_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc033/tasks/agc033_d "AtCoder 传送门") 这题感觉实在太 e 阅读全文
posted @ 2023-07-05 14:53 zltzlt 阅读(35) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc163_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc163/tasks/arc163_d "AtCoder 传送门") 怎么连这种相对传统 阅读全文
posted @ 2023-07-03 21:28 zltzlt 阅读(108) 评论(0) 推荐(0)