Hey there, I tried submitting solution to 1064D during the contest. My solution can be found here. As many of you might have noticed the solution is incorrect, I was expecting WA verdict but got RTE (on pretest 8 to be precise). I tried searching a lot but could not figure out why it was RTE and not WA. The exit code was -1073741571 if it helps.Can anyone help me with the solution(Not solution to the problem but why there was a RTE verdict). Thank You
Maybe it was because your DFS used too many stack memory
I really think that is not the reason (Not sure though) cause 2000*2000 grid dfs should not cause the stack to overflow.
If you change
#include <bits/stdc++.h>
To
and send it on Visual C++ compiler you wouldn't have RE8.
It is not giving RE8. But why, can you explain little bit?
It does. I changed your DFS to BFS and it got WA on test 40.
Thank You very much tantam75.Got the problem.