tinymon's blog

By tinymon, 4 weeks ago, In English,

Hi, I am new to codeforces :D

I was trying this problem, and I have a doubt in the editorial given here.

How do we represent the function F without the parameter H? We cannot create a DP table if H was there as it would be too large. Also, H has to be a part of the function somehow. Can anyone explain how to maintain that constraint?

Thanks for any help!

 
 
 
 

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Then the solution to our problem is just the maximum f(C) for all C where the sum of all the heights of cows in C is at least H.