Stick Lengths In this problem , sort the array and I have to make all sticks size equal to array[n/2] ( n/2 = median ) then answer should be the minimum. But why I choose median index. Can anyone explain, Please ? Thanks in advance.
Help on CSES Problem!
Stick Lengths In this problem , sort the array and I have to make all sticks size equal to array[n/2] ( n/2 = median ) then answer should be the minimum. But why I choose median index. Can anyone explain, Please ? Thanks in advance.
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en2 |
![]() |
Muhammad_mhs | 2020-09-17 18:12:52 | 42 | ||
en1 |
![]() |
Muhammad_mhs | 2020-09-17 18:10:53 | 299 | Initial revision (published) |