------
## 最终结论
```python
def maxDistToClosest(seats):
    max_distance = 0
    left = 0
    right = 0
    n = len(seats)

    while right < n:
        if seats[right] == 0:
            right += 1
        else:
            if left < right:
                empty_seats = right - left
                if left == 0 or right == n:
                    max_distance = max(max_distance, empty_seats)
                else:
                    max_distance = max(max_distance, (empty_seats + 1) // 2)
            left = right + 1
            right += 1

    if seats[0] == 0:
        max_distance = max(max_distance, right - left)

    return max_distance

# Example usage
print(maxDistToClosest([1,0,0,0,1,0,1])) # Output: 2
print(maxDistToClosest([1,0,0,0]))       # Output: 3
print(maxDistToClosest([0,1]))           # Output: 1
```