You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In line 17 we assign P2 a size of L2_n, implying we have the range [0,L2_n) available. Then we iterate i through [0,L2_n] and assign P2[i]. This leads to a problem when i = L2_n. This is a really hard to catch bug, as C++ usually allocate more size than necessary, but this very mistake has got me a runtime error in problem https://www.codechef.com/problems/TALCA?tab=statement
The text was updated successfully, but these errors were encountered:
cpbook-code/ch9/SparseTable.cpp
Lines 17 to 22 in 26fb737
In line 17 we assign
P2
a size ofL2_n
, implying we have the range[0,L2_n)
available. Then we iteratei
through[0,L2_n]
and assignP2[i]
. This leads to a problem wheni = L2_n
. This is a really hard to catch bug, as C++ usually allocate more size than necessary, but this very mistake has got me a runtime error in problem https://www.codechef.com/problems/TALCA?tab=statementThe text was updated successfully, but these errors were encountered: