#13【BZOJ2794】[Poi2012]Cloakroom

answer:

Feeling really retarded. . I didn't even think of such a simple question.

Been thinking about doing this for a dynamic backpack. . find not

First obviously we will ask to sort by a[i] according to the m sequence

Then how to satisfy b?

It's actually quite simple. . It is only necessary to record f[i] to indicate the minimum and maximum value of the previous items when they reach the volume of i

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325086273&siteId=291194637