摘要: 题意: 给出两个字符串,求出最长的公共子序列大小。 思路: 算是最经典的LCS问题吧。 设 $X=(x_1,x_2,.....x_n) 和 Y=(y_1,y_2,.....y_m)$ 是两个序列,将 X 和 Y 的最长公共子序列记为$lcs(X,Y)$ ,找出$lcs(X,Y)$就是一个最优问题 然 阅读全文
posted @ 2019-08-26 20:02 Tianwell 阅读(171) 评论(0) 推荐(0)
摘要: 题意: 题意相当于:给你六种物品,每种物品对应有 $num[i] (i为物品编号)$个,同时第 $ith$ 物品价值为&i&,现在问你能否将这些物品分成两堆,使得每堆的价值相同 思路: 我们可以用dfs去暴力搜索,当然这里使用多重背包的想法。即有 N 个物品 对应每个物品都有对应的 体积,能否找到任 阅读全文
posted @ 2019-08-26 19:23 Tianwell 阅读(135) 评论(0) 推荐(0)
摘要: "原题链接" 题意: 给你两个数 $N,M$ 你要求出 符合条件 $GCD(X,N) =M,\space (1 include include include include include define IOS ios::sync_with_stdio(0); cin.tie(0); define 阅读全文
posted @ 2019-08-26 16:00 Tianwell 阅读(142) 评论(0) 推荐(0)
摘要: 题意: 给你一个范围 $(1 define IOS ios::sync_with_stdio(0); cin.tie(0); define accept 0 define mp make_pair using namespace std; typedef long long ll; typedef 阅读全文
posted @ 2019-08-26 15:23 Tianwell 阅读(173) 评论(0) 推荐(0)
摘要: 题意: 给出一个范围 $(l,r)$ , 要求计算该范围中 满足 其中连续两位不为62, 并且不包含4 的符合条件个数。 思路: 在用数位dp写之前发现自己以前用暴力的方法过去了....(就直接枚举然后除余 4 和 64)所以明明做过一道数位dp的题,却对数位dp毫无印象.. 关于数位dp:在数位上 阅读全文
posted @ 2019-08-26 11:14 Tianwell 阅读(112) 评论(0) 推荐(0)