Back to Topic List
Hi Kevin,
I strongly believe my algorithm is correct, but again, our results differ (by a little amount) :) Could you please check once more yours?
The first row of the example input is "4 12", but after that there are only 11 buildings are given. Maybe it is related to the difference between our results (although I get 2 as result in the example with my algorithm)...
Hi Adam!
I apologize for the delayed response - quite a busy time with the holidays and new year! I hope you've been doing well in your part of the world :)
As for the problem, I'm having a difficult time tracking down a bug in the checker code logic. I produced some 10x10 boards with both dense and sparse buildings in order to check on pen-and-paper, but the results appear to be lining up with what would be expected, as far as I can tell. Although since you say that our results differ by only a little for large boards, I'm wondering if there's some edge case that's not emerging on the smaller boards.
I wanted to take a look at your code, but it looks like the character limit caused the code to get cut off during the testcase text, before showing any logic. If we want to share the code without the testcase text I'd be happy to compare for differences!
I also added a larger 100x100 board example on the page, so if our results don't agree on that one it will give us a concrete example to work off of.
And I did correct the "12" typo in the first example, thank you for pointing that out :)
Hi Kevin,
Thank you very much, we had also a nice holidays, I wish you a Happy New Year too :)
I apologize that you had to spend much time to investigate your code, I realized that I made a copy-paste bug in my code, after fixing it all the examples and real input resulted the expected answers, so sorry for this, again :)