Please read the new rule regarding the restriction on the use of AI tools. ×

Segment Tree Troubles

Revision en1, by conqueror_of_conqueror, 2016-07-28 04:39:02

Hello friends! I have tried to solve the 343D problem using a Segment Tree. When I submitted with the upper limit on the arrays of 4*MAX, it ended up with WA Test 10. Somehow, I was able to "fix" the code by changing the upper limit on the array to be 8*MAX instead of 4*MAX. Can anyone explain why this would result in a different answer (and why there is no index out of range (or some RE) when using 4*MAX)? Thanks for your help!

Submission for 4*MAX (WA): http://codeforces.me/contest/343/submission/19451573

Submission for 8*MAX (AC): http://codeforces.me/contest/343/submission/19451700

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English conqueror_of_conqueror 2016-07-28 04:39:02 675 Initial revision (published)