Unable to understand reason for MLE ?

Правка en1, от praveenojha33, 2019-06-18 10:55:32

I was solving problem https://codeforces.com/problemset/problem/601/A in which I was using simple BFS but I took MLE on test 57, but when I changed the way of marking visited node slightly it got accepted. Can anyone help me to understand the reason for this ?

This approach was Accepted. https://codeforces.com/contest/601/submission/55706140

This approach gave MLE https://codeforces.com/problemset/submission/601/55703452

The only difference is in the way how I mark visited node.

Thank You !!

Теги bfs, mle


  Rev. Язык Кто Когда Δ Комментарий
en1 Английский praveenojha33 2019-06-18 10:55:32 550 Initial revision (published)