board = []
count = 0
for i in range(19):
board.append(list(map(int, input().split())))
def side(y, x, num, dx, dy):
if x == 19 or y == 19 or x < 0 or y < 0 or (y+dy) > 18 or (x+dx) > 18:
return 0
if board[y][x] == num:
return 1+side(y+dy,x+dx, num, dx, dy)
else:
return 0
stop = True
for y in range(19):
for x in range(19):
if board[y][x] == 1 or board[y][x] == 2:
i = board[y][x]
li = []
count = side(y, x, i, 0, 1)
li.append(count)
count = side(y, x, i, 1, 0)
li.append(count)
count = side(y, x, i, 1, -1)
li.append(count)
count = side(y, x, i, 1, 1)
li.append(count)
print(li)
if li.__contains__(5):
print(board[y][x])
print(y+1,x+1)
stop = False
break
if stop == False:
break
if stop:
print(0)
#
# for i in range(10):
# for j in range(10):
# print([i, j], end=" ")
#
# print()
top of page
기능을 테스트하려면 라이브 사이트로 이동하세요.
211023
211023
댓글 0개
좋아요
댓글(0)
bottom of page