动态规划
文章平均质量分 70
acerlawson
这个作者很懒,什么都没留下…
展开
-
Aizu 1333 Beautiful Spacing
这题为某种取最值的dp提供一种解题思路,通过二分,可以使得时间复杂度从n^2降到nlogn。 dp我是倒序做的,定义dp[i]表示从第i个为该行第一个单词时,最大的空格是否小于二分的答案。 再定义两个指针从后往前边做边扫,再弄个前缀和判断指针之间是否有解,再来决定这个第i位的dp值的真假。 #include #include #include #include #include using原创 2015-03-24 00:08:35 · 323 阅读 · 0 评论 -
ZOJ3824 Fiber-optic Network
Fiber-optic Network Time Limit: 15 Seconds Memory Limit: 262144 KB Marjar University has decided to upgrade the infrastructure of school intranet by using fiber-optic technology. There are原创 2015-06-15 09:41:14 · 462 阅读 · 0 评论