随笔分类 - E 动态规划
摘要:视频链接: 参考:E99 线性DP+前缀和优化 P3643 [APIO2016] 划艇 - 董晓 - 博客园 参考:G75 拉插 CF622F The Sum of the k-th Powers - 董晓 - 博客园 P5469 [NOI2019] 机器人 - 洛谷 // 区间DP+拉插优化 O(
阅读全文
摘要:E99 线性DP+前缀和优化 P3643 [APIO2016] 划艇_哔哩哔哩_bilibili 参考:G13 同余式 乘法逆元 费马小定理 - 董晓 - 博客园 P3643 [APIO2016] 划艇 - 洛谷 // 线性DP+前缀和优化 O(n^3) #include<bits/stdc++.h
阅读全文
摘要:E98 线性DP P10741 [SEERC 2020] Fence Job_哔哩哔哩_bilibili P10741 [SEERC 2020] Fence Job - 洛谷 // 线性DP O(n^2) #include <bits/stdc++.h> using namespace std; c
阅读全文
摘要:E97 换根DP+矩阵加速 P6803 [CEOI 2020] 星际迷航_哔哩哔哩_bilibili 参考:G04 矩阵加速 P1962 斐波那契数列 - 董晓 - 博客园 P6803 [CEOI 2020] 星际迷航 - 洛谷 // 换根DP+矩阵加速 O(n+logD) #include <bi
阅读全文
摘要:E96 Tarjan缩点+树上背包 P2515 [HAOI2010] 软件安装_哔哩哔哩_bilibili 参考:D14【模板】强连通分量 Tarjan 算法 - 董晓 - 博客园 参考:E76 树上背包 P1064 [NOIP2006 提高组] 金明的预算方案 - 董晓 - 博客园 P2515 [
阅读全文
摘要:E95 01分数规划+树上背包 P1642 规划_哔哩哔哩_bilibili A07 01分数规划 - 董晓 - 博客园 (cnblogs.com) P1642 规划 - 洛谷 // 01分数规划+树上背包 复杂度:n*m*log(1e9) #include <bits/stdc++.h> usin
阅读全文
摘要:E94 Tarjan边双缩点+树形DP P8867 [NOIP2022] 建造军营_哔哩哔哩_bilibili P8867 [NOIP2022] 建造军营 - 洛谷 // Tarjan边双缩点+树形DP O(n) #include<bits/stdc++.h> using namespace std
阅读全文
摘要:E93 树形DP+树的直径 P10794『SpOI - R1』架子鼓可以站 C_哔哩哔哩_bilibili P10794 『SpOI - R1』架子鼓可以站 C - 洛谷 // 树形DP O(n) #include<bits/stdc++.h> using namespace std; int re
阅读全文
摘要:E92 换根DP+倍增 P5666 [CSP-S2019] 树的重心_哔哩哔哩_bilibili P5666 [CSP-S 2019] 树的重心 - 洛谷 // 换根DP+倍增 O(nlogn) #include<bits/stdc++.h> using namespace std; #define
阅读全文
摘要:E91 换根DP P3647 [APIO2014] 连珠线_哔哩哔哩_bilibili P3647 [APIO2014] 连珠线 - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> using namespace std; int read(){ int x=0,f=
阅读全文
摘要:E90 换根DP P6419 [COCI2014-2015#1] Kamp_哔哩哔哩_bilibili P6419 [COCI 2014/2015 #1] Kamp - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> #define int long long usi
阅读全文
摘要:E89 换根DP AT_dp_v Subtree_哔哩哔哩_bilibili AT_dp_v Subtree - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> using namespace std; #define LL long long const int N
阅读全文
摘要:E88 换根DP CF708C Centroids_哔哩哔哩_bilibili E34 树形DP 树的中心 - 董晓 - 博客园 CF708C Centroids - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> using namespace std; int r
阅读全文
摘要:E87 换根DP CF1187E Tree Painting_哔哩哔哩_bilibili CF1187E Tree Painting - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> using namespace std; const int N=200010;
阅读全文
摘要:E86 换根DP CF1324F Maximum White Subtree_哔哩哔哩_bilibili CF1324F Maximum White Subtree - 洛谷 // 换根DP O(n) #include <bits/stdc++.h> using namespace std; con
阅读全文
摘要:E85 换根DP P2986 [USACO10MAR] Great Cow Gathering G_哔哩哔哩_bilibili P2986 [USACO10MAR] Great Cow Gathering G - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> usi
阅读全文
摘要:E84【模板】换根DP P3478 [POI2008] STA-Station_哔哩哔哩_bilibili P3478 [POI 2008] STA-Station - 洛谷 // 换根DP O(n) #include<bits/stdc++.h> using namespace std; cons
阅读全文
摘要:E83 树上背包+二项式反演+排列组合 P6478 [NOI Online #2 提高组] 游戏_哔哩哔哩_bilibili P6478 [NOI Online #2 提高组] 游戏 - 洛谷 // 树上背包 O(n*m) #include<bits/stdc++.h> #define int lo
阅读全文
摘要:E82 树上背包 P4516 [JSOI2018] 潜入行动_哔哩哔哩_bilibili P4516 [JSOI2018] 潜入行动 - 洛谷 // 树上背包 O(n*k) #include<bits/stdc++.h> using namespace std; typedef long long
阅读全文
摘要:E81 树上背包 CF1830D Mex Tree_哔哩哔哩_bilibili CF1830D Mex Tree - 洛谷 // 树上背包 O(n*sqrt(n)) #include<bits/stdc++.h> using namespace std; int read(){ int d=0;ch
阅读全文
浙公网安备 33010602011771号