Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- field = []
- for _ in range(10):
- row = list(map(int, input().split()))
- field.append(row)
- def find_max_width(field):
- max_ship_width = 1
- for row in field:
- row_as_string = ''.join(map(str, row))
- for width in range(1, 11):
- ship_as_string = ''.join(['0' for _ in range(width)])
- if row_as_string.find(ship_as_string) != -1:
- max_ship_width = max(max_ship_width, width)
- return max_ship_width
- max_width = find_max_width(field)
- field = zip(*field[::-1])
- max_height = find_max_width(field)
- print(max(max_width, max_height))
Advertisement
Add Comment
Please, Sign In to add comment