riyaz panjwani
riyaz panjwani

Reputation: 11

Guide in solving spoj GiveAway

I was unable to solve the problem Spoj Give away after thinking for a while and searching for help I came to know that it involves AVL Tree + Segement Tree . Since I haven't used this data Structure yet a detail explanation of Working code and the approach is much encouraged. Link : http://www.spoj.com/problems/GIVEAWAY/

Upvotes: 1

Views: 468

Answers (1)

wingman__7
wingman__7

Reputation: 749

In SPOJ GIVEAWAY, the problem requires you to address a lot of queries and whenever we have to handle more than one queries, SQRT decomposition technique or Segment tree comes forward. I would suggest you to solve the problem using SQRT decomposition method. If you're new to both the methods, you can watch tutorials or some documentation on the internet. I'm providing some links I hope it'll help you ;)

SQRT Decomposition

Segment Tree

Upvotes: 2

Related Questions