随笔分类 -  「Codeforces」做题记录

摘要:「CF715E」Complete the Permutations Link Describe 给定长为 n 的且部分确定的置换 p,q。定义 p,q 距离为通过交换 p 任意两项变为 q 的最 阅读全文
posted @ 2023-10-28 23:10 little_pinkpig 阅读(11) 评论(0) 推荐(0) 编辑
摘要:「CF1491H」Yuezheng Ling and Dynamic Tree Solution 根据弹飞绵羊的思路,考虑分块维护一个 top(u) 表示 u 第一个不在当前块的祖先,设块长为 O(B),考虑如何求 \ 阅读全文
posted @ 2023-10-07 18:12 little_pinkpig 阅读(81) 评论(0) 推荐(0) 编辑
摘要:「CF848D」Shake It! Solution 我们可以发现题目中的图可以拆分为若干个递归的子结构,可以对这些子结构考虑 DP,设 f(i,j) 表示考虑对一个子结构 (s,t) 加入 i 个点后形成的图 阅读全文
posted @ 2023-10-06 20:27 little_pinkpig 阅读(55) 评论(0) 推荐(1) 编辑
摘要:「CF1713F」Lost Array Link Solution 考虑将前缀贡献转换为路径计数,为方便,将列编号从右向左依次编号为 0n。考虑 (0,i)(j,0) 的贡献次数其实是 阅读全文
posted @ 2023-09-20 19:44 little_pinkpig 阅读(98) 评论(0) 推荐(1) 编辑
摘要:「CF1710D」Recover the Tree Solution 考虑好区间 I1,I2(I1I2)I1I2I1I2 都是好区间。于是我们考虑从长度小开始构建。 初 阅读全文
posted @ 2022-10-15 12:41 little_pinkpig 阅读(123) 评论(0) 推荐(1) 编辑
摘要:Codeforces Round #815 (Div.2) 「CF1720A」 Burenka Plays with Fractions Codeforces 链接 Solution 每次可以对分子分母同时乘上 k,相当于对分数乘 阅读全文
posted @ 2022-08-19 22:07 little_pinkpig 阅读(57) 评论(1) 推荐(0) 编辑
摘要:「CF1661E」 Narrow Components Describe 给你一个 3n 列的 01 矩阵 a,其中 0 表示黑色格子,1 表示白色格子。 再给出 q 次讯问,每次询问给出两个整数 l,r 让你回答区间 阅读全文
posted @ 2022-08-18 01:14 little_pinkpig 阅读(28) 评论(0) 推荐(1) 编辑
摘要:「CF1174E」 Ehab and the Expected GCD Problem Describe 给定一个有 n 个数的排列 p,定义 g_i=\gcd_{j=1}^i\left{p_i\right}f(p) 为 $g_1 阅读全文
posted @ 2022-04-09 13:52 little_pinkpig 阅读(24) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up light_mode palette
选择主题
more_horiz
keyboard_arrow_up light_mode palette
选择主题