2019年1月24日

zoj3469 区间dp好题

摘要: /* 按坐标排序 以餐厅为起点向两边扩展区间 dp[i][j][0]表示送完区间[i,j]的饭后停留在左边的代价 dp[i][j][1]表示送完区间[i,j]的饭后停留在右边的代价 */ #include #include #include #include using namespace std; struct A{int x,v;}p[1050]; int... 阅读全文

posted @ 2019-01-24 22:21 zsben 阅读(149) 评论(0) 推荐(0)

区间dp好题cf149d 括号匹配

摘要: 见题解链接https://blog.csdn.net/sdjzping/article/details/19160013 阅读全文

posted @ 2019-01-24 18:14 zsben 阅读(195) 评论(0) 推荐(0)

cf1108e 线段树区间更新+扫描线

摘要: /* 有点像扫描线 思路:从左到右枚举每个点,枚举到点i时,把所有以i为起点的区间的影响删去 再加上以i-1为结尾的区间的影响 */ #include using namespace std; #define maxn 200005 #define lson l,m,rt>1; build(lson); build(rson); pushup(rt); } void ... 阅读全文

posted @ 2019-01-24 12:52 zsben 阅读(403) 评论(0) 推荐(0)

导航