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 :
|
||||
area = area_num[ny][nx]
|
||||
|
||||
if len(neighbor) == 0 :
|
||||
cnt += area_size[area]
|
||||
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)
|
||||
for n in set(neighbor) :
|
||||
cnt += area_size[n]
|
||||
|
||||
res[y][x] = cnt % 10
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user