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

Discussion of Problem 1200. Horns and Hoofs

A hint for your WA
Posted by tiancaihb 29 Sep 2009 04:46
I used O(k) algo and kept WA 14. I must have tried a thousand ways to deal with it but it doesn't work. Finally, I found out a special way. Here it is: you found out when -2x^2+(a-b+2i)x+bi-i^2 has max value --suppose it to be when "x=m". Then, round it by (int)(m+0.5000000001) (that works for sure). Here, the tricky way is to scan from "m-10" to "m+10" and find when "y" is the biggest. I finally got ac with this. Hope this can help you somehow.

Edited by author 29.09.2009 04:47

Edited by author 29.09.2009 04:48