上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 49 下一页
摘要: https://www.luogu.com.cn/problem/P3643 经典题 把范围离散化后转移可以做到$O(n^3)$ 方案数可以用用组合数计算 code: #include<bits/stdc++.h> #define mod 1000000007 #define N 2005 #def 阅读全文
posted @ 2021-12-16 20:57 lahlah 阅读(36) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF724E 模拟最小割nb题 首先可以轻易得到最大流的建图,每个点往后连边,大小为$C$,$S$向$i$连$p_i$,$i$向$T$连$s_i$ 因为最大流=最小割 考虑DP出最小割 设$f[i][j]$为考虑了前$i$个,有$j$ 阅读全文
posted @ 2021-12-16 20:45 lahlah 阅读(34) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF176E 非常重要的一个trick,我竟然不知道 首先把关键点拿出来,按照$dfs$序排后为 \(x_1,x_2,x_3,x_4,....,x_k\) 最小联通块大小$=\frac{1}{2}*(dis(x_1,x_2)+dis( 阅读全文
posted @ 2021-12-16 20:08 lahlah 阅读(95) 评论(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 阅读(41) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF704D 假设$r<c$ 首先肯定是建成二分图,通关简单分析可以知道每个点可以取的范围是 $[\frac{x-d+1}{2},\frac{x+d}{2}]$都是下取整 所以跑个上下界有源汇最大流即可 code: #include< 阅读全文
posted @ 2021-12-16 19:57 lahlah 阅读(49) 评论(0) 推荐(0)
摘要: 阿巴阿巴阿巴阿巴阿巴阿巴阿巴阿巴 阅读全文
posted @ 2021-12-15 13:16 lahlah 阅读(55) 评论(0) 推荐(0)
摘要: 阿巴阿巴阿巴 阅读全文
posted @ 2021-12-15 12:09 lahlah 阅读(129) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P6031 首先发现每次洗牌都是独立的,所以概率 ... 阅读全文
posted @ 2021-12-13 20:03 lahlah 阅读(48) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF605E 首先肯定对E排序 式子推出来这样 然后类似dijk... 阅读全文
posted @ 2021-12-10 11:19 lahlah 阅读(38) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/CF590E 本质上就是要求最长反链 首先可以用AC自动机建出一个... 阅读全文
posted @ 2021-12-10 11:13 lahlah 阅读(99) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 49 下一页