ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
back to board

Discussion of Problem 1457. Heating Main

ternary search
Posted by Григорий 1 Oct 2020 21:58
what about ternary search in this task?

Edited by author 01.10.2020 22:01
Re: ternary search
Posted by Neko_r_The_Best 29 Jul 2022 12:20
Well I tried to do so but got wa4.
I also looked at that guy's solution where he just takes the average of all p[i]. And I still cannot understand why it's right bcz, like, it's squared distance not just linear...

Edited by author 29.07.2022 12:21
Re: ternary search
Posted by Kergan 8 Nov 2022 00:32
It's because of the first derivative.