搜索结果
查询Tags标签: durations,共有 4条记录-
【leetcode】1010. Pairs of Songs With Total Durations Divisible by 60
You are given a list of songs where the ith song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the number of indices i, j such that i < j with …
2022/1/3 6:12:53 人评论 次浏览 -
【leetcode】1010. Pairs of Songs With Total Durations Divisible by 60
You are given a list of songs where the ith song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the number of indices i, j such that i < j with …
2022/1/3 6:12:53 人评论 次浏览 -
Leetcode 983. Minimum Cost For Tickets [Python]
题目给了状态转移公示: dp[i]表示第i天以及往后旅行需要的最小花费。我们需要每次花钱都覆盖尽可能多的天数。 dp[i] = dp[i+1] + 1daypass fee 或者是= dp[i+7] + 7daypass fee 或者是 = dp[i+30] + 30daypass fee三者中最小的。则dp[days[0]] 表示从第一个日期到后面的…
2021/12/31 11:07:40 人评论 次浏览 -
Leetcode 983. Minimum Cost For Tickets [Python]
题目给了状态转移公示: dp[i]表示第i天以及往后旅行需要的最小花费。我们需要每次花钱都覆盖尽可能多的天数。 dp[i] = dp[i+1] + 1daypass fee 或者是= dp[i+7] + 7daypass fee 或者是 = dp[i+30] + 30daypass fee三者中最小的。则dp[days[0]] 表示从第一个日期到后面的…
2021/12/31 11:07:40 人评论 次浏览