摘要:
传送门 由于 Di 只有 3 种情况,那么就很简单了 f[i][j][0] 表示前 i 个,且第 i 个变成 j 的 递增序列最小修改次数 f[i][j][1] 表示前 i 个,且第 i 个变成 j 的 递减序列最小修改次数 状态转移看代码。 ——代码 1 #include <cstdio> 2 # 阅读全文
posted @ 2017-05-26 11:12
zht467
阅读(259)
评论(0)
推荐(0)
摘要:
传送门 f[i] 表示送前 i 头牛过去再回来的最短时间 f[i] = min(f[i], f[j] + sum[i - j] + m) (0 <= j < i) ——代码 1 #include <cstdio> 2 #include <iostream> 3 4 const int MAXN = 阅读全文
posted @ 2017-05-26 10:45
zht467
阅读(102)
评论(0)
推荐(0)
摘要:
传送门 按价格排序后贪心 ——代码 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 5 int n; 6 long long m, ans; 7 struct node 8 { 9 long long x, y; 阅读全文
posted @ 2017-05-26 10:27
zht467
阅读(154)
评论(0)
推荐(0)
摘要:
传送门 f[i] 表示前 i 个字符去掉多少个 的最优解 直接暴力DP ——代码 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 5 int n, m, cnt, f[301]; 6 char s[301], a[60 阅读全文
posted @ 2017-05-26 09:44
zht467
阅读(193)
评论(0)
推荐(0)

浙公网安备 33010602011771号