上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: "书的复制" Code: c++ include include include using namespace std; //Mystery_Sky // define M 700 define INF 0x3f3f3f3f int f[M][M], sum[M], a[M]; int n, k; 阅读全文
posted @ 2019-06-16 11:05 Mystery_Sky 阅读(155) 评论(0) 推荐(0) 编辑
摘要: "计算字符串距离" 同样也是字符串距离计算问题,参考 "一本通 1276:【例9.20】编辑距离" Code: c++ include include include using namespace std; //Mystery_Sky // define INF 0x3f3f3f3f define 阅读全文
posted @ 2019-06-14 21:57 Mystery_Sky 阅读(908) 评论(0) 推荐(0) 编辑
摘要: "滑雪" 记忆化搜索 Code: c++ include include include using namespace std; //Mystery_Sky // define M 500 define INF 0x3f3f3f3f int f[M][M]; int r, c, map[M][M] 阅读全文
posted @ 2019-06-14 21:53 Mystery_Sky 阅读(928) 评论(1) 推荐(0) 编辑
摘要: "编辑距离" Code: c++ include include include using namespace std; //Mystery_Sky // define INF 0x3f3f3f3f define M 3000 int f[M][M]; int len_a, len_b; char 阅读全文
posted @ 2019-06-14 20:41 Mystery_Sky 阅读(723) 评论(0) 推荐(0) 编辑
摘要: "乘积最大(数据弱化版)" ps:本题无需使用大整数。 Code: c++ include include include using namespace std; //Mystery_Sky // define INF 0x3f3f3f3f define M 500 int f_max[M][M] 阅读全文
posted @ 2019-06-14 20:06 Mystery_Sky 阅读(1035) 评论(1) 推荐(0) 编辑
摘要: "合并石子" 状态转移方程:f_min[i][i] = 0, f_min[i][j] = min(f_min[i][k] + f_min[k+1][j] + sum[j] sum[i 1]; Code: c++ include include include using namespace std; 阅读全文
posted @ 2019-06-14 19:43 Mystery_Sky 阅读(1027) 评论(0) 推荐(0) 编辑
摘要: "城市交通路网" 最短路 + 路径输出 Code: c++ include include include include using namespace std; //Mystery_Sky // define M 1000100 define INF 0x3f3f3f3f struct Edge 阅读全文
posted @ 2019-06-09 21:54 Mystery_Sky 阅读(449) 评论(0) 推荐(0) 编辑
摘要: "友好城市" 对北岸(或南岸)的城市从小到大排序,再求南岸(或北岸)的城市位置的最长不下降序列长度即可。 ps:这里数据较弱,用n n的做法可以过。 Code: c++ include include include include using namespace std; //Mystery_Sk 阅读全文
posted @ 2019-06-09 21:33 Mystery_Sky 阅读(712) 评论(0) 推荐(1) 编辑
摘要: "购买巧克力Chocolate Buying" 乍一看以为是背包,然后交了一个感觉没错的背包上去。 结果无情30分。 看了一下数据范围,再仔细想了下,发现不是dp,贪心就可以了,从小到大排序费用,再从小到大买,到买不起为止即可。 Code: 阅读全文
posted @ 2019-06-09 21:11 Mystery_Sky 阅读(119) 评论(0) 推荐(0) 编辑
摘要: "机器分配" Code: c++ include include include using namespace std; //Mystery_Sky // define M 5000 int f[M][M]; int n, m, ans; int c[M][M]; void print(int i 阅读全文
posted @ 2019-06-09 20:37 Mystery_Sky 阅读(936) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页