The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. ...
分类:
其他好文 时间:
2019-08-09 01:38:39
阅读次数:
88
problem:https://leetcode.com/problems/longest-arithmetic-sequence/description/ 最长子序列类型问题。因为状态比较多,可以存在hash表里,之后直接查找。 ...
分类:
其他好文 时间:
2019-08-09 01:31:16
阅读次数:
64
一、什么是vector? 向量(Vector)是一个封装了动态大小数组的顺序容器(Sequence Container)。跟任意其它类型容器一样,它能够存放各种类型的对象。可以简单的认为,向量是一个能够存放任意类型的动态数组。 二、容器特性1.顺序序列顺序容器中的元素按照严格的线性顺序排序。可以通过 ...
分类:
其他好文 时间:
2019-08-08 23:38:23
阅读次数:
147
Recursive sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 5120 Accepted Submission(s): 2 ...
分类:
其他好文 时间:
2019-08-08 19:12:36
阅读次数:
61
题意:已知f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7,给出A,B,n,求f(n) 题解:n巨大,循环肯定超时,在模7的条件下,0<=f(n)<=6,一共7种选择,则f(n-1)和f(n-2)各有7种选择,共49种组合, ...
分类:
其他好文 时间:
2019-08-08 18:47:17
阅读次数:
84
一、什么是vector? 向量(Vector)是一个封装了动态大小数组的顺序容器(Sequence Container)。跟任意其它类型容器一样,它能够存放各种类型的对象。可以简单的认为,向量是一个能够存放任意类型的动态数组。 二、容器特性 1.顺序序列 顺序容器中的元素按照严格的线性顺序排序。可以 ...
分类:
其他好文 时间:
2019-08-07 22:42:08
阅读次数:
137
问题 J: Degree Sequence of Graph G 题目描述 Wang Haiyang is a strong and optimistic Chinese youngster. Although born and brought up in the northern inland c ...
分类:
其他好文 时间:
2019-08-07 21:02:04
阅读次数:
191
斐波那契数列的概念(下面的知识点来自百度百科) 斐波那契数列(Fibonacci sequence),又称黄金分割数列、因数学家列昂纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔子数列”, 指的是这样一个数列:1、1、2、3、5、8、13、21、34、 ...
分类:
其他好文 时间:
2019-08-06 22:49:21
阅读次数:
206
problem description: A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are ...
分类:
其他好文 时间:
2019-08-06 14:18:23
阅读次数:
93
problem:https://leetcode.com/problems/longest-consecutive-sequence/ 使用并查集,时间不是严格的O(n) ...
分类:
其他好文 时间:
2019-08-06 14:01:19
阅读次数:
85