boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 一道 facebook 电面题
相关主题
面试题count # of increasing subsequences of String求解
fb电面第一轮
Maximum Sum of Increasing Sequence
被简单题给虐了。
最长递增子array的算法
career cup book v4 9.7 题
Longest Increasing Subsequence O(NLOG(N)) 解法
看到一个longest increasing subsequence挺有意思的算法
狗家 题 讨论
请教一道题
相关话题的讨论汇总
话题: ascending话题: remove话题: sequence话题: elements话题: given
进入JobHunting版参与讨论
1 (共1页)
n*******g
发帖数: 325
1
Given a sequence of distinct integers, your program must remove as few
elements as possible in order for the elements which are not removed to
appear in ascending order. If there is more than one way to do this, your
program must print one solution, then print the number of all solutions.
Example.
Given 1 2 3 8 10 5 6 7 12 9 11 4 0
Remove 8 10 12 4 0
Remain 1 2 3 5 6 7 9 11 (ascending)
To form an ascending sequence, you must remove at least 5 elements. There is
only one way to do it.
不太理解print the number of all solutions.难道要先找出max length of the
substring,然后再来找solution?
l**********1
发帖数: 415
2
没看懂为什么要remove40!
j**7
发帖数: 143
3
longest increase subsequence
J*****a
发帖数: 4262
4
好像是复杂度nlog(n-k)?k是去除的元素数
c*******r
发帖数: 610
5
是两个数字4和0

【在 l**********1 的大作中提到】
: 没看懂为什么要remove40!
f********x
发帖数: 2086
6

大牛

【在 j**7 的大作中提到】
: longest increase subsequence
d********i
发帖数: 582
7
楼主面的是哪里的office?
w**2
发帖数: 8
8
LIS的dp 顺便计数吧
w*****9
发帖数: 28
9
longest increase subsequence is not correct?
w*******e
发帖数: 395
10
f[i] represents the length of longest increasing sub-sequence which ends at
A[i].
f[i] = max{ f[k]+1, where 0<=kf[k]}
finally, go through f[i] and find the max and the # of duplicates of max.
for example:
A: 1 2 3 8 10 5 6 7 12 9 11 4 0
f: 1 2 3 4 5 4 5 6 7 7 8 4 0
Therefore, 8 is the only solution.

is

【在 n*******g 的大作中提到】
: Given a sequence of distinct integers, your program must remove as few
: elements as possible in order for the elements which are not removed to
: appear in ascending order. If there is more than one way to do this, your
: program must print one solution, then print the number of all solutions.
: Example.
: Given 1 2 3 8 10 5 6 7 12 9 11 4 0
: Remove 8 10 12 4 0
: Remain 1 2 3 5 6 7 9 11 (ascending)
: To form an ascending sequence, you must remove at least 5 elements. There is
: only one way to do it.

相关主题
被简单题给虐了。
最长递增子array的算法
career cup book v4 9.7 题
Longest Increasing Subsequence O(NLOG(N)) 解法
进入JobHunting版参与讨论
n********e
发帖数: 41
11
大牛!
LIS nlgn 解法 一直没懂。。。

【在 J*****a 的大作中提到】
: 好像是复杂度nlog(n-k)?k是去除的元素数
G*********n
发帖数: 53
12
longest ascending sequence, Dp 经典题吧
w*********r
发帖数: 279
13

用树状数组

【在 n********e 的大作中提到】
: 大牛!
: LIS nlgn 解法 一直没懂。。。

f*******r
发帖数: 976
14
Mark.
f******n
发帖数: 279
15
mark
h*d
发帖数: 19309
16
需要输出所有最短序列List>,因为可能有多个一样长的结果。

is

【在 n*******g 的大作中提到】
: Given a sequence of distinct integers, your program must remove as few
: elements as possible in order for the elements which are not removed to
: appear in ascending order. If there is more than one way to do this, your
: program must print one solution, then print the number of all solutions.
: Example.
: Given 1 2 3 8 10 5 6 7 12 9 11 4 0
: Remove 8 10 12 4 0
: Remain 1 2 3 5 6 7 9 11 (ascending)
: To form an ascending sequence, you must remove at least 5 elements. There is
: only one way to do it.

w******k
发帖数: 299
17
mark
1 (共1页)
进入JobHunting版参与讨论
相关主题
请教一道题
one amazon interview problem
刷题刷习惯了,今天面试二了。。
严格单调递增的最长子序列
贡献一个groupon的电面题
一朋友被Google的电面干掉了 (转载)
google题
问个算法题5
问一个经典题
数组里找最大集合,该集合排序后是序列,有漂亮解法么?
相关话题的讨论汇总
话题: ascending话题: remove话题: sequence话题: elements话题: given