Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是从给定广告牌中移除广告牌的副本,我已经仔细阅读了这个问题(和其他问题)的答案,但我仍然无法理解它?他的回答中的灵魂检查是什么意思?
我不需要代码,我只想用简单的英语解释算法。如果提供示例,我将不胜感激。
他建议制作和 P[n,k] 数组,其中 P[i,j] 将存储可以从广告牌 1..i 获得的最大可能值(利润)(必要时删除其中一些),这样右边正好有j个连续的广告牌。
编辑:顺便说一下,这个解决方案不符合问题的要求(N <= 10^5)