01分数规划
一个经典模型是,
求(frac{sum(a_i*x_i)}{sum(b_i*x_i)})的最值,
首先颓柿子,设(ans=frac{sum(a_i*x_i)}{sum(b_i*x_i)})
于是(ans*{sum(b_i*x_i)}=sum(a_i*x_i))
然后(ans*{sum(b_i*x_i)}-{sum(a_i*x_i)}=0)
二分(ans)来将该柿子卡成0
一个经典模型是,
求(frac{sum(a_i*x_i)}{sum(b_i*x_i)})的最值,
首先颓柿子,设(ans=frac{sum(a_i*x_i)}{sum(b_i*x_i)})
于是(ans*{sum(b_i*x_i)}=sum(a_i*x_i))
然后(ans*{sum(b_i*x_i)}-{sum(a_i*x_i)}=0)
二分(ans)来将该柿子卡成0