code is https://ide.codingblocks.com/s/112179
quest link is https://hack.codingblocks.com/contests/c/948/763
The program gets end when sample test cases for second queries are put.
Bfs shotest distance
@S19LPPP0039
The problem is providing with vertices from 1 to n while your code is working on nodes 0 to n-1. This is bound to give you a runtime error as your code will try to access array indices which will be out of bounds.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.