11262 - Weird Fence

All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

New poster
Posts: 5
Joined: Tue Dec 02, 2014 6:03 pm

Re: 11262 - Weird Fence

Post by lehuyduc » Thu Dec 04, 2014 9:14 am

I've found the mistake, it's not about the precision error. I forgot to add some edges :D. Thanks for helping anyway.

New poster
Posts: 10
Joined: Wed Aug 14, 2013 7:53 pm

Re: 11262 - Weird Fence

Post by catweazle352 » Fri Jul 22, 2016 7:40 pm


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
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.


It's easy to beef about something - but it's much harder to make it better

Post Reply

Return to “Volume 112 (11200-11299)”