随笔分类 -  DS

摘要:「CF1037H」Security 有关字典序可以依次考虑 T 的每一位转化为询问 O(|Σ||T|) 个字符串在区间 [l,r] 的存在性判断。因为可以用线段树合并维护 SAM 上每个等价类的 \(\t 阅读全文
posted @ 2024-09-06 22:16 little_pinkpig 阅读(19) 评论(0) 推荐(0) 编辑
摘要:「ABC222H」Beautiful Binary Tree Link Describe 对于一个正整数 n,我们称满足以下条件的有根二叉树是一棵美丽的 n 阶二叉树。 每个节点有一个数字 01阅读全文
posted @ 2023-11-28 17:31 little_pinkpig 阅读(35) 评论(1) 推荐(0) 编辑
摘要:heart Solution 可以记 f(u) 为从 u 出发到某个点停止的方案数,f(u) 可以 O(n) 转移,显然复杂度为 O(n2). 当前我们要转移 u 子树内 阅读全文
posted @ 2023-11-14 22:13 little_pinkpig 阅读(33) 评论(1) 推荐(0) 编辑
摘要:「GLR-R3」 惊蛰 Link Describe 给定非负整数序列 {an},定义函数 f(x,y) 为 \[f(x,y)=\begin{cases} x-y,&x\ge y\\ C,&x< y \end{ca 阅读全文
posted @ 2023-11-02 22:11 little_pinkpig 阅读(52) 评论(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) 编辑
摘要: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) 编辑

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