Hi,↵
↵
AC Code (2.5s): [submission:56017075] ([Or here if you can't view gym submissions](https://ideone.com/k6GHKd)) ↵
TLE (over 30s, tested on customgroupprivate group contest with custom TL): [submission:56017081] ([Or here](https://ideone.com/ZElu57))↵
↵
The onlyRegardless of the problem and its solution, the ONLY line that changes between the 2 submissions is the way I check if the state was calculated before or not. When I check it using `if (ret != -1)` it gives TLE, but when I check it using visit array `is (visit[i][j] == vid)` it passes. I don't even remove the extra memset for memoization array in each testcase when using the visit array. Why would this very small change result in that huge difference in time?
↵
AC Code (2.5s): [submission:56017075] ([Or here if you can't view gym submissions](https://ideone.com/k6GHKd)) ↵
TLE (over 30s, tested on custom
↵