随笔分类 - dp--单调队列/单调栈优化
摘要:https://www.luogu.org/problemnew/show/P1823 自己只会一个log的 设取的人的位置分别是l,r(l<r) 这个做法大概是考虑枚举r,设法对于每个r求出有多少个满足的l 1 #include<cstdio> 2 #include<algorithm> 3 #i
阅读全文
摘要:https://www.luogu.org/problemnew/show/P3957 错误记录:1.没开longlong 2. -inf不够小 1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 #include<vecto
阅读全文
摘要: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]+
阅读全文
摘要:Mice and Holes CodeForces - 797F 题意:有n只老鼠和m个洞,都在一个数轴上,老鼠坐标为x[1],...,x[n],洞的坐标为p[1],...,p[m],每个洞能容纳的老鼠为c[1],...,c[m],问所有老鼠都躲到洞里后每只老鼠跑的距离之和的最小值。 分析: 如果不
阅读全文

浙公网安备 33010602011771号