5.13
jys
posted @ May 13, 2014 02:15:51 AM
in 未分类
, 932 阅读
最近做了SCOI2014GDOI2014
觉得智商还是有问题
看到一种牛逼的决策单调优化
def work(L, R, dl, dr) :
m = (L + R) / 2
for i = dl to dr :
update g[m] using i
if L == R : return
let dm be the optimal decision of m
work(L, m - 1, dl, dm)
work(m + 1, R, dm, dr)