上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 38 下一页
摘要: https://www.luogu.com.cn/problem/P7342 贡献法,从对角线出发走到 \((0,n-1)\),也就是从 \(F(x,y)=F(x,y)(\frac{1}{(1-x)(1-y)}-1)+1,F(x,y)=\frac{1-x-y+xy}{1-2(x+y-xy)}=(1- 阅读全文
posted @ 2026-05-20 09:20 TallBanana 阅读(26) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/arc220 performance: 1824 A - Sum of Reciprocals of Squares \(n=x^2\) 可以构造 \(n\) 个 \(\frac{1}{x^2}\)。 \(\frac{1}{x^2}\) 可以变 阅读全文
posted @ 2026-05-18 09:39 TallBanana 阅读(43) 评论(0) 推荐(0)
摘要: https://cplusoj.com/d/master/contest/6a058a9cc3e1ba0889c35849 T1 早八(class) 类似猫树,一个区间的贡献挂在其跨过中点的线段树节点上。 那么只需要节点内关心上课的前后缀连续段,我们可以使用二维偏序计算没有贡献的权值和。 主席树维护 阅读全文
posted @ 2026-05-15 13:41 TallBanana 阅读(43) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P14010 类似 IOI2012 理想城 缩行/列,变成 \(dis_1(u,v)+dis_2(u,v)\)。 T1 点分治,建出虚树,然后 T2 虚树点分治,统计合法路径数量,复杂度 \(O(n\log^2 n)\),空间 \(O 阅读全文
posted @ 2026-05-14 21:56 TallBanana 阅读(47) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF936E 类似 IOI2012 理想城,将行/列缩点,所以变成求 \(\min_{x\in S} dis_1(u,x)+dis_2(u,x)\)。 cdq,只用处理到静态的点集最近距离。 对第二棵树点分治,距离转化为 \(dep_ 阅读全文
posted @ 2026-05-14 21:51 TallBanana 阅读(23) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P6137 分别考虑 x 轴和 y 轴的贡献。 假设下面考虑 y 轴贡献,那么将每个连续的行缩成一个点,然后如果两行有公共点就连边。 这样连出一棵树,两点之间一定是走这个树边到达。所以计算 \(\sum s_i(n-s_i)\) 就好 阅读全文
posted @ 2026-05-14 20:54 TallBanana 阅读(24) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P6132 人话:有标号根向森林,一个森林的系数为 \(k^{\mathrm{cntEdge}}\),要求每个点入度在集合 \(S\) 内。\(S\subseteq\{0,1,2,3\}\)。 首先必须有 \(0\in S\),否则一 阅读全文
posted @ 2026-05-13 20:38 TallBanana 阅读(27) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P5850 GF:\(n![x^n]\prod_{i=1}^k (ix+1)\)。 重点考虑后面那个多项式如何求: \[\begin{aligned} F(x)&=\exp(\sum_{i=1}^k \ln(ix+1))\\ &=\e 阅读全文
posted @ 2026-05-13 20:32 TallBanana 阅读(35) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF1603D 代价:\(c(l,r)=\sum_{d=l}^{r} S_\varphi(\left\lfloor\frac{r}{d}\right\rfloor)\)。 代价满足四边形不等式。 注意到如果一个段满足 \(2l>r\) 阅读全文
posted @ 2026-05-13 19:17 TallBanana 阅读(25) 评论(0) 推荐(0)
摘要: https://cplusoj.com/d/senior/contest/69faf5321363e1a076b48956 AT_agc002_e [AGC002E] Candy Piles 我们可以将石子堆从大到小排序,每次可以删除一行/一列。 等价于从左下角开始往右上走,走到边界上就死了。 发现 阅读全文
posted @ 2026-05-13 11:35 TallBanana 阅读(31) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 38 下一页