上一页 1 2 3 4 5 6 7 8 ··· 37 下一页
摘要: ##题目传送门 首先知道一个斐波那契数列的通式$F_n = \frac {1}{\sqrt{5}} * ((\frac{1+\sqrt{5}}{2}){n+1}-(\frac{1-\sqrt{5}}{2}){n+1})$ 二项式定理:\((x+y)^n = \Sigma_{i=0}^n C^i_nx 阅读全文
posted @ 2020-10-05 16:57 Mr^Simon 阅读(103) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 \(dp,将矩阵的每一个格转化成一个物品,然后跑背包\) #include<iostream> #include<cstdio> #include<cstring> using namespace std; long long n,m,t,s,tot,c[10001],w[10001 阅读全文
posted @ 2020-09-14 09:16 Mr^Simon 阅读(83) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 \(f_{i,j}表示到了第i位,已经擦掉了j位的最佳答案\) #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n,c[1001],f 阅读全文
posted @ 2020-09-14 09:13 Mr^Simon 阅读(70) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 \(字符串dp,f_{i,j}表示a串到第i位和b串到第j位的最小距离,转移和LCS一样\) #include<cstdio> #include<cstring> #include<iostream> #include<cmath> using namespace std; stri 阅读全文
posted @ 2020-09-14 09:09 Mr^Simon 阅读(60) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 一道$dp$,$f_{i,j}$表示到第$i$位,已经踩准了$j$次的最佳答案. #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,t,s[5001],b[5001]; i 阅读全文
posted @ 2020-09-14 09:03 Mr^Simon 阅读(73) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 记忆化搜索,以每个不为负数的花为根,向外扩展,找最大联通块. #include<iostream> #include<cstdio> #include<cstring> #include<map> using namespace std; int n,a[16001],tot,hea 阅读全文
posted @ 2020-09-13 22:48 Mr^Simon 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 树形dp,$f_{i,j}$表示以i为根,子树删j条边的最少苹果数 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,q,head[101],si[101],m,pp,an 阅读全文
posted @ 2020-09-13 22:43 Mr^Simon 阅读(77) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 一道dp,但我没推出方程,只好写记忆化搜索+剪枝. 主要说一下为什么从小到大排序,如果大的块被选择且最终得出符合题意的答案,那么后面很多状态都会被剪掉,因为答案越搜越小(应该是). #include<iostream> #include<cstdio> #include<cstrin 阅读全文
posted @ 2020-09-13 21:11 Mr^Simon 阅读(80) 评论(0) 推荐(1) 编辑
摘要: ##题目传送门 两维限制的背包,$f_{i,j}$表示重力为i,阻力为j的最长时间,和01背包一样转移,最后用一个数组保存一下方案即可 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int m,v 阅读全文
posted @ 2020-09-12 21:51 Mr^Simon 阅读(113) 评论(0) 推荐(0) 编辑
摘要: ##题目传送门 源点向每个试题连容量为1的边,试题向试题类型连容量为1的边,试题类型向汇点连容量为本类型所需题数的边.跑最大流 #include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<vector> 阅读全文
posted @ 2020-09-12 21:47 Mr^Simon 阅读(129) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 37 下一页