某岛

… : "…アッカリ~ン . .. . " .. .
June 12, 2024

wqs 二分

https://oj.uz/problem/view/NOI19_feast

经典题,首先这个题有一个众所周知的神奇做法,既贪心 k 次,每次求出最优子序列,然后取反。
这个做法首先当然再 k 很大的时候有点力不从心,只能拿 59 分,而且如果要求每次必选,好像正确性也变得堪忧了。
https://oj.uz/submission/997020

当然此题的 wqs 二分非常好写,可以作为例题。
https://oj.uz/submission/997059

https://codeforces.com/contest/1279/problem/F

和例题几乎一样。

https://www.luogu.com.cn/problem/P3606

也可以从导数的角度考虑,类似 [NOI2012] 骑行川藏,最优状态时每段的导数必然相等,因此直接二分这个导数即可。这题貌似也是。 https://loj.ac/p/3132

Luogu P5896. [IOI2016] aliens

https://www.luogu.com.cn/problem/P5896

Luogu P6246. [IOI2000] 邮局 加强版 加强版

https://www.luogu.com.cn/problem/P4767
https://www.luogu.com.cn/problem/P6246

树相关