![:D](./images/smilies/icon_biggrin.gif)
11262 - Weird Fence
Moderator: Board moderators
Re: 11262 - Weird Fence
I've found the mistake, it's not about the precision error. I forgot to add some edges
. Thanks for helping anyway.
![:D](./images/smilies/icon_biggrin.gif)
-
- New poster
- Posts: 10
- Joined: Wed Aug 14, 2013 7:53 pm
Re: 11262 - Weird Fence
Hi,
I did a binary search answer. I only used integer arithmetic. Providing my code with the sample input of udebug results in a correct answer. I even generated random input on myself and tested it on udebug, my output was always correct.
I now heavily documented my code and hope that someone give my a hint or at least a critical test case:
My mistake was to use a greedy algorithm to get a matching. Unfortunately the input provided on udebug did not reveal that error, it seems to be that greedy (first sorting blue-red connections by distance) is quite good (but not good enough, of course).
I provided an additionally set of input data on udebug in order to reveal such mistakes in the future.
Cheers
Christof
I did a binary search answer. I only used integer arithmetic. Providing my code with the sample input of udebug results in a correct answer. I even generated random input on myself and tested it on udebug, my output was always correct.
I now heavily documented my code and hope that someone give my a hint or at least a critical test case:
Code: Select all
removed after AC
I provided an additionally set of input data on udebug in order to reveal such mistakes in the future.
Cheers
Christof
It's easy to beef about something - but it's much harder to make it better