Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

ka89's blog

By ka89, history, 8 years ago, In English

Hi all,

I am trying to solve a problem on SPOJ.

GANNHAT spoj

This is a problem about kd trees i think, but I havent been able to solve it. I searched forums and got a hint regarding how this can also be done using Fenwick trees, but I am still not able to get much insights.

N is large so algorithm does need to run in O(nlogn) or better. Can anyone please help me in this? Some lines on how this can be solved using BIT, or any suggestion you can share would be very helpful.

Thanks Anant

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?