Please help me debugging my BFS code

Правка en1, от vishudon, 2021-07-28 12:57:30

Hello,

I am solving below problem and I have already solved this problem using DFS, but then I tried to solve it using BFS too. I know that below problem can be solved using both BFS and DFS.

I have written a solution using BFS, but my solution is failing at #19 test case (not complete visible test case). I tried hard to debug my code, but can't understand where is the problem in my code. I checked many BFS solutions for this problem, but none of the solution could help me resolving issue in my code. Can someone please help me with this ? Any help will be appreciated. Thanks in advance.

Problem Link: https://codeforces.com/contest/510/problem/B

My Solution Link: https://codeforces.com/contest/510/submission/124016916 ( This solution is failing at #19 test case)

Теги #bfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vishudon 2021-07-28 12:57:30 824 Initial revision (published)