baekjoon 20260307 modify 16946.py
This commit is contained in:
parent
7b7e92fece
commit
2571466cbc
@ -48,20 +48,10 @@ for x, y in wall :
|
|||||||
|
|
||||||
if 0 <= nx < M and 0 <= ny < N and area_num[ny][nx] != -1 :
|
if 0 <= nx < M and 0 <= ny < N and area_num[ny][nx] != -1 :
|
||||||
area = area_num[ny][nx]
|
area = area_num[ny][nx]
|
||||||
|
neighbor.append(area)
|
||||||
|
|
||||||
if len(neighbor) == 0 :
|
for n in set(neighbor) :
|
||||||
cnt += area_size[area]
|
cnt += area_size[n]
|
||||||
neighbor.append(area)
|
|
||||||
else :
|
|
||||||
dupli_check = True
|
|
||||||
|
|
||||||
for n in neighbor :
|
|
||||||
if n == area :
|
|
||||||
dupli_check = False
|
|
||||||
|
|
||||||
if dupli_check :
|
|
||||||
cnt += area_size[area]
|
|
||||||
neighbor.append(area)
|
|
||||||
|
|
||||||
res[y][x] = cnt % 10
|
res[y][x] = cnt % 10
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user