File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,11 @@ def bfs(x, y):
2222 c [x ][y ] = 1
2323 maxN = 0
2424 while q :
25- [ x , y ] = q .popleft ()
25+ x , y = q .popleft ()
2626 for i in range (4 ):
2727 Nx , Ny = x + dx [i ], y + dy [i ]
28- if 0 < Nx < N and 0 < Ny < M and maze [Nx ][Ny ] == 'L' :
28+ if 0 <= Nx < N and 0 <= Ny < M and maze [Nx ][Ny ] == 'L' and c [ Nx ][ Ny ] == 0 :
2929 q .append ([Nx , Ny ])
30- maze [Nx ][Ny ] = 'W'
3130 c [Nx ][Ny ] = c [x ][y ]+ 1
3231 maxN = max (c [Nx ][Ny ], maxN )
3332 return maxN - 1
@@ -36,6 +35,6 @@ def bfs(x, y):
3635for i in range (N ):
3736 for j in range (M ):
3837 if maze [i ][j ] == 'L' :
39- maxCount = (maxCount , bfs (i , j ))
38+ maxCount = max (maxCount , bfs (i , j ))
4039
4140print (maxCount )
Original file line number Diff line number Diff line change 55str = 'sre'
66print (str [- 1 ])
77
8- print (1 << 0 )
8+ print (1 << 0 )
9+ a , b = 1 , 2
10+ print (a )
11+ print (b )
You can’t perform that action at this time.
0 commit comments