lahlahblog喵~

WELCOME

喵~

  • CSDN个人博客地址:https://blog.csdn.net/qq_38944163 欢迎大家来踩

    12 2021 档案

    摘要:https://www.luogu.com.cn/problem/P1587 首先思考我们要求的是什么? {xkly}={xy} \( 阅读全文
    posted @ 2021-12-29 09:26 lahlah 阅读(34) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P4213 才发现杜教筛是个这么naive的东西,我觉得我也可以发明出来 给出狄利克雷卷积的几个重要性质 μI=ϵ ϕI=id μid=ϕ 满足结合律和交换律 设$\large S( 阅读全文
    posted @ 2021-12-29 08:23 lahlah 阅读(25) 评论(0) 推荐(0) 编辑
    摘要:菜的真实 C没看清楚数据范围炸了两发血亏 D用二项式定理展开一下就是个很naive的东西了 后两题比较有意思 E - Medals 首先可以发现天数的上限是2n1e5 显然可以二分答案 先考虑如何建图 左边是员工,右边是天数,根据Hall定理我们知道,对于左边的每个子集 G,都要满足 阅读全文
    posted @ 2021-12-23 21:10 lahlah 阅读(37) 评论(0) 推荐(0) 编辑
    摘要:菜的真实 T3,T4卡大题还行 C - Camels and Bridge 首先看数据范围肯定不是一个多项式复杂度的算法 考虑枚举全排列,那么怎么判断头尾最短的长度是多少呢? 其实也不难,只要把每个连续段开到必须要开长度,然后大的继承小的即可 具体实现可以看代码 code: #include<bit 阅读全文
    posted @ 2021-12-22 21:39 lahlah 阅读(59) 评论(0) 推荐(1) 编辑
    摘要:https://www.luogu.com.cn/problem/P7530 按照套路,我们记pre[i]表示上一个和i相同颜色的位置 考虑扫描线,记f[l]\(线\)(pre[r],r1)f[l]和 考虑i[l,r],pre[i] 阅读全文
    posted @ 2021-12-22 08:06 lahlah 阅读(74) 评论(0) 推荐(1) 编辑
    摘要:https://www.luogu.com.cn/problem/P6667 和20年省选很像,一下子没想出来怎么做,还是不够熟练 f由点值给出,考虑到后面有组合数,还有幂函数,不妨考把f写成下降幂多项式的形式 \(\sum\limits_{k=0}^n\binom{n}{k}x^k(1-x 阅读全文
    posted @ 2021-12-22 07:40 lahlah 阅读(86) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P5394 之前一直以为是什么阴间东西,没有碰,现在菜知道原来是个挺naive的东西 我们把设点值的指数型生成函数为G(x)=i=0F(i)i!xi \(\large =\s 阅读全文
    posted @ 2021-12-21 21:43 lahlah 阅读(39) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P7531 玄妙DP题被BEST定理淦过去的这个出题人Benq就是逊啊 首先回忆一把BEST定理是什么 一个有向图欧拉回路的数量设为F,一个以rt为根的内向生成树个数为G \(T=G\prod_{i=1}^n (in[ 阅读全文
    posted @ 2021-12-21 16:34 lahlah 阅读(25) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P7416 对于每个数,记lst[i]表示上一个和i颜色相同的位置 如果lst[i]<l显然ans+1 如果min(lst[i],i)<a[i]那么ans+1(把lst[i]设为0即可) 然后就变成了询 阅读全文
    posted @ 2021-12-21 16:23 lahlah 阅读(53) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P5243 大意就是给出若k棵树,每棵树选一条路径,然后花kx的长度把他们连成一个环 问环的长度Y的方案数 首先肯定可以先把Y=kx 然后就变成了一个经典问题,每个树暴力ni2跑出来所有的方案,路 阅读全文
    posted @ 2021-12-21 16:13 lahlah 阅读(46) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P4183 学到许多 显然要求出来一个f[u]表示离u最近的叶子距离 考虑对于一个节点的情况,把它设为根 求出来以它为根的每个点的深度,记为dep[u] 手玩一下容易发现对于每个节点,叶子是否需要的放判断是 \(f[u]< 阅读全文
    posted @ 2021-12-21 16:03 lahlah 阅读(31) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P5667 主要是要知道可以把它先便偏移一下,然后再卷积 b[i]=1mn+i code: #include<bits/stdc++.h> #define ll long long #define mod 阅读全文
    posted @ 2021-12-17 09:05 lahlah 阅读(52) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF997C![在这里插入图片描述](https://img-blog.csdnimg.cn/2cd5342716b64cc5be90f552ad307b41.png?x-oss-process=image/watermark,typ 阅读全文
    posted @ 2021-12-17 09:02 lahlah 阅读(71) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P4707 kthminmax容斥入门题 懒得证明了 式子就是 max(S)=TS(1)|T|k(|T|1k1)min(T) 设计DP f[i][j][k]表示考虑前 阅读全文
    posted @ 2021-12-17 09:01 lahlah 阅读(33) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P4332 成功复习了LCT 首先发现状态改变的一定是叶子向上的一条路径 我们记录sum[u]表示u节点有几个儿子是1val[u]=sum[u]>1 这样维护最大值和最小值,每次access一下然后在$Spl 阅读全文
    posted @ 2021-12-17 08:49 lahlah 阅读(32) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P2791 赞美出题人(bushi 如果做过luogu P6031 CF1278F Cards 加强版 这题,按照套路推一推就可以推出来了 注意其中有一步要用范德蒙德卷积 code: #include<bits/stdc++.h> # 阅读全文
    posted @ 2021-12-17 08:44 lahlah 阅读(55) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P7323 考场上降大智了 首先发现如果x>y,y>z合法,那么x>z也一定合法 那么对于这样的同种颜色的两条边y>x,z>x,那么z>y一定合法 就可以把z,y合并 一路合并下去,再看看每个集合里有多 阅读全文
    posted @ 2021-12-17 08:37 lahlah 阅读(32) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P7324 70分的DP非常好想和好写 我们其实不用关心具体的值是什么,只用关心相对大小 拿个真值表进去随便搞搞即可 code: #include<bits/stdc++.h> // 11 : < 12 : > 13 : ? #def 阅读全文
    posted @ 2021-12-17 08:33 lahlah 阅读(39) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P4694 首先可以用wqs二分去掉K的那个限制 然后可以发现剩下的就是一个模拟费用流了 code: #include<bits/stdc++.h> #define ll long long #define N 500050 阅读全文
    posted @ 2021-12-17 08:26 lahlah 阅读(44) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P6122 NB模拟费用流题 费用流的建图不难,我们考虑如何模拟这个过程 可以暴力模拟这个过程因为树的高度只有logn所以可以暴力去找增广路,然后暴力增广 维护一下每个点儿子中最近的关键点即可 然后记录一下每条边的流量和方向 c 阅读全文
    posted @ 2021-12-17 08:13 lahlah 阅读(40) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P5631 类似SUM那题 挖掉某一块后看是否还是能构成生成树 考虑分治,用按秩合并并查集来维护联通性 code: #include<bits/stdc++.h> #define N 2000050 using namespace s 阅读全文
    posted @ 2021-12-17 07:26 lahlah 阅读(50) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF678F 首先一眼线段树分治 然后线段树上每个节点建一个凸包,在上面三分即可 code: #include<bits/stdc++.h> #define ll long long #define N 300050 using na 阅读全文
    posted @ 2021-12-17 07:20 lahlah 阅读(126) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P3545 模拟费用流入门题 能满足就满足 不能满足考虑反悔,替换掉前面一个bj最大的,如果bj<bi那就没有必要替换 code: #include<bits/stdc++.h> #define N 250050 #de 阅读全文
    posted @ 2021-12-16 22:06 lahlah 阅读(51) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P5470 模拟费用流硬分析讨论即可 具体看 https://djy-juruo.blog.luogu.org/solution-p5470 code: #include<bits/stdc++.h> #define N 200050 阅读全文
    posted @ 2021-12-16 22:00 lahlah 阅读(25) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF1519E 可以考虑连边 (aibi+1)(cidi) (aibi)(cidi+1) 然后跑最大匹配 code: #inc 阅读全文
    posted @ 2021-12-16 21:27 lahlah 阅读(46) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P3643 经典题 把范围离散化后转移可以做到O(n3) 方案数可以用用组合数计算 code: #include<bits/stdc++.h> #define mod 1000000007 #define N 2005 #def 阅读全文
    posted @ 2021-12-16 20:57 lahlah 阅读(31) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF724E 模拟最小割nb题 首先可以轻易得到最大流的建图,每个点往后连边,大小为CSipi,iTsi 因为最大流=最小割 考虑DP出最小割 设f[i][j]为考虑了前i个,有j 阅读全文
    posted @ 2021-12-16 20:45 lahlah 阅读(28) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF176E 非常重要的一个trick,我竟然不知道 首先把关键点拿出来,按照dfs序排后为 x1,x2,x3,x4,....,xk 最小联通块大小$=\frac{1}{2}*(dis(x_1,x_2)+dis( 阅读全文
    posted @ 2021-12-16 20:08 lahlah 阅读(82) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF1188D 奇妙DP题 https://www.luogu.com.cn/blog/RUI-R/solution-cf1188d 重点是要知道可以分别考虑每一位,按后几位排序后进位的一定是一个前缀,这样就可以优化状态数 code: 阅读全文
    posted @ 2021-12-16 20:04 lahlah 阅读(31) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF704D 假设r<c 首先肯定是建成二分图,通关简单分析可以知道每个点可以取的范围是 [xd+12,x+d2]都是下取整 所以跑个上下界有源汇最大流即可 code: #include< 阅读全文
    posted @ 2021-12-16 19:57 lahlah 阅读(44) 评论(0) 推荐(0) 编辑
    摘要:阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴 阅读全文
    posted @ 2021-12-15 13:16 lahlah 阅读(46) 评论(0) 推荐(0) 编辑
    摘要:阿巴阿巴阿巴 阅读全文
    posted @ 2021-12-15 12:09 lahlah 阅读(116) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/P6031 首先发现每次洗牌都是独立的,所以概率 ... 阅读全文
    posted @ 2021-12-13 20:03 lahlah 阅读(38) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF605E 首先肯定对E排序 式子推出来这样 然后类似dijk... 阅读全文
    posted @ 2021-12-10 11:19 lahlah 阅读(27) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF590E 本质上就是要求最长反链 首先可以用AC自动机建出一个... 阅读全文
    posted @ 2021-12-10 11:13 lahlah 阅读(84) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF516D 注意到 ... 阅读全文
    posted @ 2021-12-10 10:48 lahlah 阅读(60) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4995 枚举最后移动到的那个点,然后考虑DP 设 ... 阅读全文
    posted @ 2021-12-09 19:46 lahlah 阅读(71) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT5140 奇妙的构造题 首先发现 ... 阅读全文
    posted @ 2021-12-09 07:12 lahlah 阅读(38) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4994 考虑将曼哈顿距离的绝对值拆开,变成 又因为题目要求... 阅读全文
    posted @ 2021-12-08 20:57 lahlah 阅读(68) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4928 NB题,大受震撼 ... 阅读全文
    posted @ 2021-12-07 07:41 lahlah 阅读(47) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4927 ... 阅读全文
    posted @ 2021-12-06 21:51 lahlah 阅读(65) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4518 考虑如果有解,一定存在欧拉回路 那么所有点到度数一定... 阅读全文
    posted @ 2021-12-06 20:19 lahlah 阅读(42) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4514 往01中间插一根红线,10中间插一根蓝线,如上图 ... 阅读全文
    posted @ 2021-12-06 19:50 lahlah 阅读(51) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/AT4505 考虑建图,每个集合连向集合内的点,连出一个二分图 得... 阅读全文
    posted @ 2021-12-06 19:47 lahlah 阅读(32) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF755F 还是有点意思的这题 首先考虑少的,显然每个环先放 ... 阅读全文
    posted @ 2021-12-04 08:13 lahlah 阅读(48) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF1439B ... 阅读全文
    posted @ 2021-12-04 08:12 lahlah 阅读(27) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF1301F 因为 ... 阅读全文
    posted @ 2021-12-04 08:11 lahlah 阅读(32) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF576D 不小心点了一下推荐题目,然后这题就会了 首先每条边按... 阅读全文
    posted @ 2021-12-04 08:10 lahlah 阅读(54) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF1110F 考虑先把问题离线下来, 用线段树维护当前点到所有叶... 阅读全文
    posted @ 2021-12-04 08:09 lahlah 阅读(25) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF1325E 有些启发性的题目 首先发现 ... 阅读全文
    posted @ 2021-12-04 08:08 lahlah 阅读(30) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF741C 怎么在ZR做过两次的题还是没想出来,逊捏 考虑对于 ... 阅读全文
    posted @ 2021-12-04 08:07 lahlah 阅读(27) 评论(0) 推荐(0) 编辑
    摘要:https://www.luogu.com.cn/problem/CF464E 晚修结束前十分钟打开,想了一会没半点思路 杨队过来一... 阅读全文
    posted @ 2021-12-04 08:03 lahlah 阅读(62) 评论(0) 推荐(0) 编辑
    摘要:真实水平好吧 8说了,卷起来 ABC230G - GCD Permutation 考虑 ... 阅读全文
    posted @ 2021-12-04 08:00 lahlah 阅读(83) 评论(0) 推荐(0) 编辑

    点击右上角即可分享
    微信分享提示