Блог пользователя It_Wasnt_Me

Автор It_Wasnt_Me, 4 года назад, По-английски

https://codeforces.com/contest/195/problem/D I am so close to the solution but there is something that confuse me

the problem describe that $$$S(x)$$$ is sum of $$$n$$$ functions, the solution just use $$$F(x)$$$ for each line,

Should I consider $$$S(x)$$$ so I should sum all $$$k_i$$$ and $$$b_i$$$ ? https://codeforces.com/contest/195/submission/67170155 Anyone know why I am wrong?

Can anyone help me If he have explanation for the solution or explain the tutorial more because it is a bit unclear for me. :)

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

See, you are adding up all the lines of form y = kx + b so you are considering sum of functions = y1 + y2 + y3 ....etc but problem here is that you must notice that f = kx+ b is only true when kx+b > 0 Otherwise y = 0, in other words, all the ys will NOT CONTRIBUTE to the sum of functions always because maybe at some x, they are negative, at such an x they won't contribute. Only, when a particular y becomes positive, will it start contributing to the sum of functions.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    aha, I got you. but what make the solution works if I consider only $$$F(x)$$$, Could you explain the solution a bit more ?

»
4 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I still stuck on this problem :( Could anyone help me