摘要: 视频链接:https://www.bilibili.com/video/BV1Ff4y1e7YW/ #include<bits/stdc++.h> using namespace std; const int N=34; int a[N]; //把B进制数的每一位抠出存入数组 int f[N][N] 阅读全文
posted @ 2023-04-10 10:23 董晓 阅读(647) 评论(0) 推荐(0)
摘要: 视频链接:https://www.bilibili.com/video/BV1fa4y1H7J6/ Luogu P2657 [SCOI2009] windy 数 #include <bits/stdc++.h> using namespace std; const int N = 12; int a 阅读全文
posted @ 2023-04-10 10:22 董晓 阅读(772) 评论(0) 推荐(2)
摘要: 视频链接:https://www.bilibili.com/video/BV1fy4y1q79f/ #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N=12; int 阅读全文
posted @ 2023-04-10 10:21 董晓 阅读(997) 评论(0) 推荐(1)
摘要: 视频链接:E35 树形DP 积蓄程度_哔哩哔哩_bilibili 3585 -- Accumulation Degree #include <iostream> #include <cstring> #include <algorithm> using namespace std; const in 阅读全文
posted @ 2023-04-10 10:20 董晓 阅读(577) 评论(0) 推荐(1)
摘要: E34 树形DP 树的中心_哔哩哔哩_bilibili U392706 【模板】树的中心 - 洛谷 在树中,如果节点 u 作为根节点时,从 u 出发的最长链最短,那么称 u 为树的中心。 树的中心不一定唯一,但最多有 2 个,且这两个中心是相邻的。 树的中心一定位于树的直径上。 树上所有点到其最远点 阅读全文
posted @ 2023-04-10 10:20 董晓 阅读(789) 评论(0) 推荐(0)
摘要: E33 树形DP 树的直径_哔哩哔哩_bilibili U81904 【模板】树的直径 - 洛谷 树上任意两节点之间最长的简单路径即为树的直径。 一棵树可以有多条直径,他们的长度相等。 若树上所有边边权均为正,则树的所有直径中点重合。 // 树的直径 树形DP O(n) #include<bits/ 阅读全文
posted @ 2023-04-10 10:19 董晓 阅读(1042) 评论(3) 推荐(2)
摘要: E32 树形DP 树的重心_哔哩哔哩_bilibili U104609 【模板】树的重心 - 洛谷 如果删除树中某个节点,使得各个子树的最大节点数最小,则该节点被称为树的重心。 树的重心如果不唯一,则至多有 2 个,且这两个重心相邻。 以树的重心为根时,所有子树的大小都不超过整棵树大小的一半。 树中 阅读全文
posted @ 2023-04-10 10:18 董晓 阅读(1246) 评论(0) 推荐(3)
摘要: 视频链接:https://www.bilibili.com/video/BV1cv411b7EG/ HDU1400 Mondriaan's Dream #include <iostream> #include <cstring> #include <algorithm> using namespac 阅读全文
posted @ 2023-04-10 10:17 董晓 阅读(833) 评论(0) 推荐(2)
摘要: E30 区间DP 能量项链_哔哩哔哩_bilibili P1063 [NOIP 2006 提高组] 能量项链 - 洛谷 // 区间DP O(n^3) #include <bits/stdc++.h> using namespace std; const int N=210; int n, a[N]; 阅读全文
posted @ 2023-04-10 10:16 董晓 阅读(591) 评论(0) 推荐(1)
摘要: E29 区间DP 环形石子合并_哔哩哔哩_bilibili P1880 [NOI1995] 石子合并 - 洛谷 // 区间DP O(n^3) #include <bits/stdc++.h> using namespace std; const int N=210; int n,a[N],s[N]; 阅读全文
posted @ 2023-04-10 10:15 董晓 阅读(692) 评论(0) 推荐(0)
摘要: E28【模板】区间DP 石子合并——信息学竞赛算法_哔哩哔哩_bilibili P1775 石子合并(弱化版) - 洛谷 [1,1] [2,2] [3,3] [4,4] [5,5] [1,2] [2,3] [3,4] [4,5] [1,3] [2,4] [3,5] [1,4] [2,5] [1,5] 阅读全文
posted @ 2023-04-10 10:14 董晓 阅读(976) 评论(0) 推荐(2)
摘要: 视频链接:https://www.bilibili.com/video/BV1vy4y1z7qy/ Luogu P2704 [NOI2001] 炮兵阵地 #include <iostream> #include <cstring> #include <algorithm> using namespa 阅读全文
posted @ 2023-04-10 10:13 董晓 阅读(873) 评论(0) 推荐(4)
摘要: 视频链接:https://www.bilibili.com/video/BV1BA411j7Qv/ Luogu P1879 [USACO06NOV]Corn Fields(玉米田) POJ3254 Corn Fields #include <iostream> #include <cstring> 阅读全文
posted @ 2023-04-10 10:12 董晓 阅读(970) 评论(2) 推荐(1)
摘要: 视频链接:https://www.bilibili.com/video/BV1pf4y1q7hU/ Luogu P1896 [SCOI2005] 互不侵犯 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个 阅读全文
posted @ 2023-04-10 10:11 董晓 阅读(1260) 评论(0) 推荐(5)
摘要: 视频链接:https://www.bilibili.com/video/BV15v411r7WD/ #include <iostream> #include <cstring> using namespace std; const int N = 100010; int w[N],f[N][2]; 阅读全文
posted @ 2023-04-10 10:10 董晓 阅读(463) 评论(0) 推荐(2)
摘要: 视频链接:https://www.bilibili.com/video/BV1ka4y1s7ER/ #include<iostream> #include<cstring> using namespace std; const int N=100010, M=110; int w[N], f[N][ 阅读全文
posted @ 2023-04-10 10:09 董晓 阅读(565) 评论(1) 推荐(1)
摘要: 视频链接:https://www.bilibili.com/video/BV1iK4y177jT/ #include<iostream> #include<cstring> using namespace std; const int N = 100010; int w[N],f[N][2]; in 阅读全文
posted @ 2023-04-10 10:08 董晓 阅读(623) 评论(0) 推荐(1)
摘要: 视频链接:https://www.bilibili.com/video/BV1TK4y1E7ft/ // 分步转移 #include<iostream> using namespace std; const int N=100010; int w[N],f[N]; int main(){ int n 阅读全文
posted @ 2023-04-10 10:06 董晓 阅读(685) 评论(1) 推荐(1)
摘要: 视频链接:https://www.bilibili.com/video/BV1454y1C7AR/ #include<iostream> #include<cstring> using namespace std; const int N = 1010; int v[N],w[N]; int f[N 阅读全文
posted @ 2023-04-10 10:05 董晓 阅读(609) 评论(0) 推荐(0)
摘要: 视频链接:https://www.bilibili.com/video/BV16K411A7iC/ // 不超背包容量的方案数 #include<iostream> #include<cstring> using namespace std; const int N=1010, mod=1e9+7; 阅读全文
posted @ 2023-04-10 10:04 董晓 阅读(743) 评论(0) 推荐(2)