I tried with KD-tree. Maybe I have an error, but I want to know if it's a good approach since some of my colleagues who also used KD tree had partial scores.
Z-mushrooms
I've used quad trees. Currently it has got 5/20 correct answers, rest of them time limit error (on the contest this code had a bug slowing down it and all of them were TLE).
KD trees are similar so that should be good in theory.
KD trees are similar so that should be good in theory.
Yeah, so I've read on wiki. Let the debuging begin!
hm, I barely pass first two cases with KD-tree. Perhaps quad-tree turns out to be more balanced if the inputs are random points.
I use KD tree and it passes without any problems. :P
( and no, I don't do any rotations on my KD tree )
( and no, I don't do any rotations on my KD tree )
well the thing is KD trees can have practically O(n) complexity for getting NN...maybe there are some ways to optimise them...