Help in Segment Tree Problem(HELPR2D2 — Help R2-D2!)

Revision en1, by ritik_patel05, 2020-04-17 15:29:09

Problem : HELPR2D2 — Help R2-D2!

Solution : Link

Approach : I stored in each leaf node K(Volume left to use) and in the parent node, I summed up the volume of children's node. For querying, I try to go as much left as I can and update the volume used. I cross-checked with several cases. But cannot find where it's going wrong on submission.

If someone has solved this question, I really appreciate your help. Thank you!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ritik_patel05 2020-04-17 15:29:09 578 Initial revision (published)