← Back to topics
Topic

Z-mushrooms

t
tgudlek
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.
R
RobertGerbicz
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.
t
tgudlek
Yeah, so I've read on wiki. Let the debuging begin!
t
thocevar
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.
s
stjepang
I use KD tree and it passes without any problems. :P
( and no, I don't do any rotations on my KD tree )
M
MilosRadic
well the thing is KD trees can have practically O(n) complexity for getting NN...maybe there are some ways to optimise them...