随笔分类 -  dp--单调队列/单调栈优化

摘要:https://www.luogu.org/problemnew/show/P1823 自己只会一个log的 设取的人的位置分别是l,r(l<r) 这个做法大概是考虑枚举r,设法对于每个r求出有多少个满足的l 1 #include<cstdio> 2 #include<algorithm> 3 #i 阅读全文
posted @ 2018-10-28 20:42 hehe_54321 阅读(222) 评论(0) 推荐(0)
摘要:https://www.luogu.org/problemnew/show/P3957 错误记录:1.没开longlong 2. -inf不够小 1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 #include<vecto 阅读全文
posted @ 2018-10-20 15:17 hehe_54321 阅读(153) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-09-12 22:12 hehe_54321 阅读(1235) 评论(1) 推荐(0)
摘要:One hundred layer HDU - 4374 $sum[i][j][k]$表示第i层第j到k列的和 $ans[i][j]$表示第i层最终停留在第j列的最大值,那么显然$ans[i][j]=max(ans[i-1][j-t]+sum[i][j-t][j],..,ans[i-1][j+t]+ 阅读全文
posted @ 2017-10-27 18:36 hehe_54321 阅读(251) 评论(0) 推荐(0)
摘要:Mice and Holes CodeForces - 797F 题意:有n只老鼠和m个洞,都在一个数轴上,老鼠坐标为x[1],...,x[n],洞的坐标为p[1],...,p[m],每个洞能容纳的老鼠为c[1],...,c[m],问所有老鼠都躲到洞里后每只老鼠跑的距离之和的最小值。 分析: 如果不 阅读全文
posted @ 2017-09-12 19:16 hehe_54321 阅读(366) 评论(0) 推荐(0)

AmazingCounters.com