Does someone know how to solve QCHEF using Segment Trees?

mo
qchef
segment-tree
segment-trees
segment_tree
sqrt-decomp

#1

I have feeling that it is always possible to solve such type of problems using Segment Trees, however it is not that intuitive as using Mo’s algorithm instead. Is here anyone who knows or saw a solution using Segment Trees? I’d appreciate it if someone could give me an explanation. Thanks in advance!


#2

i dont think it was possible to code it with segment trees


#3

@dudechandan has solved it
his solution-
http://www.codechef.com/viewsolution/6497315


#4

how we can invite him here to have discussion with us?