合集-Winter Vacation Study Record

摘要:适用于多源汇求最短路的问题 原理: 基于动态规划 AcWing-854 AC code: #include <iostream> #include <algorithm> #include <cstring> using namespace std; const int N=510,INF=1e9; 阅读全文
posted @ 2024-02-26 16:38 Eric` 阅读(15) 评论(0) 推荐(0) 编辑
摘要:p2758-编辑距离 思路: 用f[i][j]表示第一个字符串的前 i 个字母变为第二个字符串的前 j 个字母所用的最少操作次数。 假设第一个字符串为:AGTCTGACGC 第二个字符串为:AGTAAGTAGGC f[3][5] 表示把第一个字符串的前三个字母变为第二个字符串的前五个字母所需要的最少 阅读全文
posted @ 2024-02-27 21:26 Eric` 阅读(6) 评论(0) 推荐(0) 编辑
摘要:AcWing-900 思路: 转换成完全背包问题 时间复杂度: o(n^3) AC代码: #include <iostream> #include <algorithm> using namespace std; const int N=1010,mod=1e9+7; int n; int f[N] 阅读全文
posted @ 2024-02-27 22:03 Eric` 阅读(16) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示