
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.
The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.
This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.
Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.
The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.
Your music player contains
N
different songs and she wants to listen toL
(not necessarily different) songs during your trip. You create a playlist so that:K
other songs have been playedReturn the number of possible playlists. As the answer can be very large, return it modulo
10^9 + 7
.Example 1:
Example 2:
Example 3:
Note:
0 <= K < N <= L <= 100
这道题说是一个音乐播放器有N首歌,有个她想听L首歌(可以有重复),但需要满足两个条件,一个是每首歌都必须至少播放1次,第二个是两首重复歌的中间至少要有K首其他的歌。提示了结果可能非常巨大,需要对一个超大数取余。对于这类结果超大的数,基本不用怀疑,基本都是用动态规划 Dynamic Programming 来做,这里主要参考了 大神 optimisea 的帖子。首先就是要确定 dp 的定义式,显然这里一维的 dp 数组是罩不住的,因为貌似有三个参数,N,L 和 K。但是否意味着需要个三维数组呢,其实也不用,并不关心所有的K值,但是对于N和L是必须要关注的,这里用一个二维 dp 数组,其中 dp[i][j] 表示总共放了i首歌,其中j首是不同的。下面来考虑状态转移方程,在加入一首歌的时候,此时有两种情况:
综上所述可以得到状态转移方程:
参见代码如下:
Github 同步地址:
#920
参考资料:
https://leetcode.com/problems/number-of-music-playlists/
https://leetcode.com/problems/number-of-music-playlists/discuss/178415/C%2B%2BJavaPython-DP-Solution
https://leetcode.com/problems/number-of-music-playlists/discuss/180338/DP-solution-that-is-Easy-to-understand
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: