r/programmingchallenges • u/bobhob314 • Sep 27 '15
Help me solve this Fenwick tree problem?
http://wcipeg.com/problem/tc
3
Upvotes
r/programmingchallenges • u/bobhob314 • Sep 27 '15
View all comments
Show parent comment
1
u/bobhob314 Sep 28 '15
Can you walk me through the problem? I know how to implement 2D Fenwick Tree (thanks for the link btw!) but I'm not sure how it applies here. As well, the constraints are N ≤ 300000 so I don't think that a 2D Fenwick Tree could be implemented under the memory (or real-life) constraints, as 3000002 = 9*1010.