Initialize queue
queue1 = [ ] NEW_LINE queue1 . append ( [ 0 , 0 ] ) NEW_LINE dist = [ 1e9 for i in range ( n ) ] NEW_LINE ways1 = [ 0 for i in range ( n ) ] NEW_LINE dist [ 0 ] = 0 NEW_LINE ways1 [ 0 ] = 1 NEW_LINE