Skip to content

DP Note

Xin Wan edited this page Apr 2, 2018 · 2 revisions

滚动数组优化

f[i] = max(f[i - 1], f[i - 2] + A[i]);
转化为
f[i % 2] = max(f[(i - 1) % 2]) 和 f[(i - 2) % 2])

博弈类题目

https://drive.google.com/file/d/1U0j4LW6SU9SFpkq7jIapd1OPYgKbaOcV/view?usp=sharing

Clone this wiki locally