摘要:
##题目传送门 类比最长公共子序列,$f_{i,j,k}$表示到$A_i,B_j,C_k$的最大答案,然后跟最长公共自序列一样转移即可 #include<iostream> #include<cstdio> #include<cstring> using namespace std; string 阅读全文
posted @ 2020-09-12 21:36
Mr^Simon
阅读(161)
评论(0)
推荐(0)
摘要:
##题目传送门 $f_{i,j}\(表示以\)(i,j)$为左下角能得到的最大正方形的边长. #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,t,f[1001][1001],ans; b 阅读全文
posted @ 2020-09-12 21:29
Mr^Simon
阅读(96)
评论(0)
推荐(0)
摘要:
##题目传送门 源点到i单位的连容量为$r_i$的边,单位到每个餐桌连容量为1的边,餐桌j到汇点连容量为$c_j$的边,跑最大流 #include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<queue 阅读全文
posted @ 2020-09-12 21:26
Mr^Simon
阅读(110)
评论(0)
推荐(0)
摘要:
##题目传送门 源点向每个英国飞行员连容量为1的边,英国飞行员向每个外籍飞行员连容量为inf的边,外籍飞行员向汇点连容量为1的边,跑最大流. #include<iostream> #include<cstdio> #include<cstring> #include<queue> #include< 阅读全文
posted @ 2020-09-12 21:17
Mr^Simon
阅读(75)
评论(0)
推荐(0)
摘要:
##题目传送门 板子不解释 #include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<vector> #define pd(i) (i % 2 == 1) ? i + 1 : i - 1 #defin 阅读全文
posted @ 2020-09-12 21:12
Mr^Simon
阅读(79)
评论(0)
推荐(0)
摘要:
##题目传送门 分别f[i][1/0]表示到第i位从前面或从后面子序列的最大和,最后枚举断点即可. #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n; long long f[100000 阅读全文
posted @ 2020-09-12 21:09
Mr^Simon
阅读(144)
评论(0)
推荐(0)
摘要:
##题目传送门 ##题目传送门2 f[i]表示到第i位最少要删的字符数,对于每个i,将其作为最后一位向前跟w个单词匹配,如果向前匹配到第k位,那就用f[k-1]转移,在匹配过程中记录需要删去元素的个数. #include<iostream> #include<cstdio> #include<cst 阅读全文
posted @ 2020-09-12 20:57
Mr^Simon
阅读(91)
评论(0)
推荐(0)

浙公网安备 33010602011771号