------
## 最终结论
```python
def canWin(n: int) -> bool:
    dp = [False] * (n + 1)
    dp[0] = False  # Initialize dp[0] to False
    
    for i in range(1, n + 1):
        j = 1
        while j * j <= i:
            if not dp[i - j * j]:  # If opponent loses, current player wins
                dp[i] = True
                break
            j += 1
            
    return dp[n]
```