i did this problem http://www.codechef.com/problems/MARBLEGF using segmented tree concept..but i am getting tle...editorial say to use fenwick tree concept......But i came to know both fenwick tree and segmented tree have same time complexity in worst case which is O(mlogn)....anyone clear my doubt plsss.....thanks in advance:) this is my code which uses the concept of segment tree http://www.codechef.com/viewsolution/3436231 asked 17 Feb '14, 16:33

I read somewhere that the constant factor in complexity calculation of segment tree is more than BIT. So for extremely steep time limit, BIT is effective. answered 18 Feb '14, 20:40
