随笔分类 -  题解

摘要:CF1662F 遇到绝对值想想拆开。 考虑优化 bfs 时扩展过程,设当前点为 i,考虑 i,j 连边。 |\(i-j\)|\(\leq\) \(\min(p_i,p_j)\),则 j 至少应该在 [\(i-p_i\),\(i+p_i\)]。 分类讨论一下 \(j\geq i\) 时 \(j-i\l 阅读全文
posted @ 2023-11-14 22:00 StranGePants 阅读(54) 评论(1) 推荐(1)
摘要:Goose, Goose, DUCK? 对于这种确定 L,R 可简单求出区间答案的问题,我们常常考虑通过固定端点,移动另一端计算贡献。 具体的,我们移动 R,计算[1,R]中的点对答案的贡献。 假设某个值在 [1,R] 中出现位置为 \(1\leq a_1,a_2...a_m\leq R\),可以得 阅读全文
posted @ 2023-11-13 21:46 StranGePants 阅读(55) 评论(0) 推荐(0)
摘要:男人不轻易流泪,直到你说 I stay 阅读全文
posted @ 2023-11-05 22:42 StranGePants 阅读(140) 评论(3) 推荐(0)
摘要:FaZe Clan,CS2 两连冠 阅读全文
posted @ 2023-11-05 22:31 StranGePants 阅读(62) 评论(2) 推荐(0)
摘要:mir 要被上帝惩戒了 阅读全文
posted @ 2023-11-01 19:01 StranGePants 阅读(64) 评论(0) 推荐(0)
摘要:斜眼哥你怎么萎了/kk 阅读全文
posted @ 2023-11-01 09:20 StranGePants 阅读(35) 评论(0) 推荐(0)
摘要:CF551E 卧槽,lzh最爱的分块!卧槽,lzh最爱的分块!卧槽,lzh最爱的分块!卧槽,lzh最爱的分块! 维护懒标,散块重构。 unordered_map<long long,int> 会 TLE unordered_map<long long,bool> 会 AC #include<cstd 阅读全文
posted @ 2023-10-30 22:33 StranGePants 阅读(50) 评论(3) 推荐(0)
摘要:狗枣是什么枣 阅读全文
posted @ 2023-10-30 22:20 StranGePants 阅读(37) 评论(0) 推荐(0)
摘要:iostream 阅读全文
posted @ 2023-10-29 14:49 StranGePants 阅读(59) 评论(0) 推荐(0)
摘要:一键挖矿 弱化版(?):CF562F 将矩阵扩展一个单位(长宽均加1),把当前存在的格子染色。 可以发现当且仅当恰好存在4个有1个格子被染色,不存在有3个格子被染色的2x2矩阵时满足题意。 枚举右端点 r,设 g(l) 表示选择 [l,r] 时有多少个上述矩阵。 可以发现 g(r)=4,且对于 x\ 阅读全文
posted @ 2023-10-26 20:54 StranGePants 阅读(94) 评论(3) 推荐(0)
摘要:Two Sets 因为和最大,从高位向低位考虑,称 n 个元素的异或和为 SUM,若 SUM 这一位为0,则两堆都分配1一定更优,否则为了第一堆尽量小我们把偶数个1分给第一堆,高斯消元即可,因为是01矩阵用 bitset 优化一下。 其实因为我们是动态列出等式所以处理过程与线性基类似。 #inclu 阅读全文
posted @ 2023-10-25 22:34 StranGePants 阅读(80) 评论(0) 推荐(0)
摘要:DZY Loves Planting 逆天题。 想到二分,判断用网络流,但是好像 n 有点大。 我们想尽量让每个点的 g 能大于下界,所以我们尽量往大的边走,其实就是尽量不走小的边。 所以考虑将边从小到大排序,每次合并两端的连通块,如果剩下点的 x 总和小于总点数就只能内部消化。 又因为这已经是最劣 阅读全文
posted @ 2023-10-20 19:22 StranGePants 阅读(49) 评论(0) 推荐(0)
摘要:Saintex 1分钟就切啦,有什么好说哒! 首先可能想到设 \(c_{i,j}\) 表示(i,j)被操作的次数,那么答案很好求。 但是这个数量并不好记录。 如果仅仅钦定(i,j)从小到大之类的东西也不好搞。 所以考虑钦定其他的东西。 设 \(dp_{i,j,k}\) 表示前 i 位,有 j 个操作 阅读全文
posted @ 2023-10-15 19:34 StranGePants 阅读(53) 评论(0) 推荐(0)
摘要:阿乐你真是个线下虫,线上龙 阅读全文
posted @ 2023-10-10 21:51 StranGePants 阅读(71) 评论(0) 推荐(0)
摘要:悉尼揭幕战,暗黑破坏神大战原神 阅读全文
posted @ 2023-10-04 22:35 StranGePants 阅读(67) 评论(2) 推荐(0)
摘要:转 A 转 B 再转 A 阅读全文
posted @ 2023-09-30 22:32 StranGePants 阅读(40) 评论(0) 推荐(0)
摘要:德国战车碾压土耳其 阅读全文
posted @ 2023-09-27 22:36 StranGePants 阅读(44) 评论(2) 推荐(0)
摘要:floppy 再为北美突破一次吧! 阅读全文
posted @ 2023-09-25 21:57 StranGePants 阅读(53) 评论(0) 推荐(0)
摘要:小孩下放之日,三叶封神之时! 阅读全文
posted @ 2023-09-20 21:42 StranGePants 阅读(45) 评论(0) 推荐(0)
摘要:感性! 阅读全文
posted @ 2023-09-18 23:38 StranGePants 阅读(34) 评论(0) 推荐(0)