can any one help on segment trees ,how to use segment tree in this problem???

1 Like

read about segment trees with lazy propagation

i tried a lot but canâ€™t seem to implement it with this problem if you can help a bit moreâ€¦

Try using arrays , instead of binary tree for constructing segment tree

@sakuag333 why we should use arrays instead of binary tree??kindly helpâ€¦ http://www.codechef.com/viewsolution/5271503 â€¦my soln of flipcoin using binary tree is giving right answer for sample test cases and random inputs but wrong answer on submissionâ€¦ Kindly help