tinymon's blog

By tinymon, 5 years 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!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 years 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.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    -,- read that. but how do i check for that H?

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Let S(C) be the .

      Let then S(C) = S(C - c) + Hc.