------
## 最终结论
```python
def mincostTickets(days, costs):
    dp = [0] * 366
    day_set = set(days)

    for i in range(1, 366):
        if i not in day_set:
            dp[i] = dp[i - 1]
        else:
            dp[i] = min(dp[i - 1] + costs[0],  # 1-day pass
                         dp[max(0, i - 7)] + costs[1],  # 7-day pass
                         dp[max(0, i - 30)] + costs[2])  # 30-day pass

    return dp[365]

# Example usage:
# days = [1,4,6,7,8,20]
# costs = [2,7,15]
# print(mincostTickets(days, costs))  # Output: 11
```