It happens. Try thinking more about 'can I code/implement this in a way which makes it impossible to make silly mistakes'. For example in this case you could do
dp[0][0] = INFINITY, dp[0][1] = tri[0][1], dp[0][2] = tri[0][1] + tri[0][2] and then just run the dp from i=1. A lot fewer (and simpler) cases than setting the first two rows.
P.S. #include bits/stdc++.h contains all libraries, so you could use it instead of the many includes in your header