上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 30 下一页
摘要: # [[ABC184D] increment of coins](https://www.luogu.com.cn/problem/AT_abc184_d) ## 思路 设 $f(A,B,C)$ 表示三种金币有 $A,B,C$ 时要到达 $100$ 的概率。 $f(A,B,C)=(\dfrac{A} 阅读全文
posted @ 2023-08-01 20:05 wscqwq 阅读(10) 评论(0) 推荐(0) 编辑
摘要: # [[ABC187E] Through Path](https://www.luogu.com.cn/problem/AT_abc187_e) ## 思路 我们考虑利用 `dfs` 序将树转换成一个序列(树链剖分中的一小部分),如下图所示: ![](https://cdn.luogu.com.cn 阅读全文
posted @ 2023-08-01 19:48 wscqwq 阅读(4) 评论(0) 推荐(0) 编辑
摘要: # [[ABC202E] Count Descendants](https://www.luogu.com.cn/problem/AT_abc202_e) 考虑一个判断某个点 $v$ 是否为另一个点 $u$ 后代的方法:令 $dfn_v$ 表示 $v$ 的 $dfs$ 序,令 $out_u$ 表示离 阅读全文
posted @ 2023-08-01 18:36 wscqwq 阅读(15) 评论(0) 推荐(0) 编辑
摘要: # [[ABC201E] Xor Distances](https://www.luogu.com.cn/problem/AT_abc201_e) 首先,根据 $a\oplus a=0$,一条路径 $dis(u,v)=(dis(1,\text{LCA})\oplus dis(1,u))\oplus( 阅读全文
posted @ 2023-08-01 11:58 wscqwq 阅读(10) 评论(0) 推荐(0) 编辑
摘要: # [[ABC292F] Regular Triangle Inside a Rectangle](https://www.luogu.com.cn/problem/AT_abc292_f) 首先,最大的正三角形的三个顶点,一个是矩形顶点,另两个在边上,如图。 ![](https://cdn.luo 阅读全文
posted @ 2023-08-01 10:54 wscqwq 阅读(5) 评论(0) 推荐(0) 编辑
摘要: # [[ABC293G] Triple Index](https://www.luogu.com.cn/problem/AT_abc293_g) 借本题来描述一下莫队算法。 莫队算法是将询问离线排序,使得时间复杂度控制在 $n\sqrt n$ 的量级。 首先考虑暴力做法,每次对于一个询问,将询问中的 阅读全文
posted @ 2023-08-01 10:27 wscqwq 阅读(10) 评论(0) 推荐(0) 编辑
摘要: # [[ABC293F] Zero or One](https://www.luogu.com.cn/problem/AT_abc293_f) 考虑有两种求法: 1. 枚举 $b$,然后暴力分解判断。 2. 枚举答案的位数,然后在每一位上填 $0/1$,二分法判断。 我们考虑~~中庸之道(bushi 阅读全文
posted @ 2023-07-31 14:45 wscqwq 阅读(8) 评论(0) 推荐(0) 编辑
摘要: # [创世纪](https://www.acwing.com/problem/content/description/361/) 首先考虑树的情况。 为了方便,还是将基环树的边反向。 令 $f[u][0/1]$ 表示当前点不选/选的答案。 1. 若当前的点不选,那么其子节点任意,$\sum\max( 阅读全文
posted @ 2023-07-31 10:54 wscqwq 阅读(6) 评论(0) 推荐(0) 编辑
摘要: # [[ZJOI2008] 骑士](https://www.luogu.com.cn/problem/P2607) 如果是一棵树,那么等价于[没有上司的舞会](https://www.luogu.com.cn/problem/P1352)。 为了方便进行 `DP`,我们将边的方向进行反转。 然后我们 阅读全文
posted @ 2023-07-31 09:27 wscqwq 阅读(15) 评论(0) 推荐(0) 编辑
摘要: # [**Geometric Progression**](https://atcoder.jp/contests/abc293/tasks/abc293_e) 分治+提取公因式即可。 注意 $M=1$ 的情况,这里卡了很久。 # [AC](https://atcoder.jp/contests/a 阅读全文
posted @ 2023-07-30 21:26 wscqwq 阅读(3) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 30 下一页