
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.
如果序列
X_1, X_2, ..., X_n满足下列条件,就说它是 斐波那契式 的:n >= 3i + 2 <= n,都有X_i + X_{i+1} = X_{i+2}给定一个严格递增的正整数数组形成序列,找到 A 中最长的斐波那契式的子序列的长度。如果一个不存在,返回 0 。
(回想一下,子序列是从原序列 A 中派生出来的,它从 A 中删掉任意数量的元素(也可以不删),而不改变其余元素的顺序。例如,
[3, 5, 8]是[3, 4, 5, 6, 7, 8]的一个子序列)提示:
3 <= A.length <= 10001 <= A[0] < A[1] < ... < A[A.length - 1] <= 10^9(对于以 Java,C,C++,以及 C# 的提交,时间限制被减少了 50%)
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
思路
dp[i]表示从0 ~ i可以得到的斐波那契子序列(或者长度小于 3,作为一个预备可选项)的所有组合。数组里的每一项需要分别维护:sum: 当前斐波那契子序列的最后两项的和。head:当前斐波那契子序列的最后两项的第一个数字。len: 当前斐波那契子序列长度。之所以只需要关心
最后两项,是因为能否和下一个数字组成斐波那契子序列,只需要考虑上一个子序列的尾部两个数字即可,比如[1, 2, 3]是一个斐波那契子序列,但是它之后去和5组合,只需要考虑[2, 3]与5的可组合性。当我们记录下来sum为5了以后,只需要去找到5这个数字,就确定可以组合成一个斐波那契子序列了。而记录
head是因为,找到了[2, 3, 5]以后,是需要把2这一项给删除掉,以3 + 5作为下一个目标sum的,所以必须要有地方记录下来2这个数字。而下一项的
head应该是 3,这个如何得出呢?其实只需要用上一次记录的sum: 5减去上一次的head: 2,即可得出上一次的末尾3,作为下一次的head。也就是说
sum其实是两个元素所组成的数组在不断的向后“滑动”,上一次的尾部就是下一次的头部。最后,在求出的所有结果里找出
len最大的那一项就可以了。