由买买提看人间百态

topics

全部话题 - 话题: subsequent
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
M*****8
发帖数: 17722
1
【 以下文字转载自 Military 讨论区 】
发信人: MB80528 (肥猫(Contrarian)[食MM而肥]), 信区: Military
标 题: Re: 岐山说中国不怕贸易战因为中国人民吃草都能过一年
发信站: BBS 未名空间站 (Fri Sep 21 15:19:40 2018, 美东)
其实类似这种谈判的手法事实证明是非常有效果的。
懂得用类似这种谈判手法的都是有创意,智勇双全。
例如:
Major Abdessalam Jalloud was entrusted with the supervision of the Libyan
oil sector, which represented 96% of the country's income. In September 1970
Jalloud succeeded in imposing a rise in oil prices to all companies
operating in Libya, opening the way for the other oil producers and for t... 阅读全帖
w*********s
发帖数: 2136
2
Is Japan's Elite Hiding A Weapons
Program Inside Nuclear Plants?
By Yoichi Shimatsu
4-6-11
Confused and often conflicting reports out of Fukushima 1 nuclear plant
cannot be solely the result of tsunami-caused breakdowns, bungling or
miscommunication. Inexplicable delays and half-baked explanations from Tokyo
Electric Power Company (TEPCO) and the Ministry of Economy, Trade and
Industry (METI) seem to be driven by some unspoken factor.
The smoke and mirrors at Fukushima 1 seem to obscure a steady... 阅读全帖
c****n
发帖数: 21367
3
你是对的,对成年人只ban了text msg
具体情况很复杂,最初的提案是所有年龄,全部cellphone usage都ban
但是提案里面有一部分(关于>75岁renew驾照的)阻力很大,修改的时候
就连cellphone ban都修改了,最后的bill是
18岁以下,所有手机应用全ban,包括handfree device
18岁以上,ban text msg,不许阅读手机(iphone之类智能手机用户惨被屠戮)
新闻如下
House Bill 4795 makes it illegal for all drivers to compose, read, or send
text messages from a mobile phone or an electronic device. Violators would
face a $100 fine for a first offense, $250 for a second offense and $500 for
any subsequent offense.
For drivers under the age of 18, ... 阅读全帖
N********n
发帖数: 543
4
这里是总的链条,很多详细内容,大家如果感兴趣,可以看看
http://townhall-talk.edmunds.com/direct/view/.f2281d7
Re: Sienna Ratings [indyguy5] by pact95
Mar 03, 2011 (5:01 am)
Replying to: indyguy5 (Mar 01, 2011 1:42 pm)
I wanted to provide some information I received from the NHTSA on the crash
test of the Sienna, with some
comparison to the Honda. Hopefully this helps people with their decisions.
The Toyota Sienna received a 2-star rating for the right front passenger
while the Honda Odyssey received
a 5-star. This rating i... 阅读全帖
B*Z
发帖数: 7062
5
来自主题: Automobile版 - Ward 二十世纪十大发动机
The 10 Best Engines of the 20th Century
Don Sherman | WardsAuto
Jan 1, 2000
It took a century for automotive engines to mature from cantankerous
contraptions to the smooth, reliable machinery that currently enables our
mobility. The following honor roll celebrates the 10 best - those engines
that motored far beyond the call of duty to advance the internal-combustion
cause.
Ford Motor Co. Model T Inline-4 (1909) After eight lackluster designs, Henry
Ford finally hit paydirt with his 1909 Model T.... 阅读全帖
m****s
发帖数: 18160
6
【 以下文字转载自 Database 讨论区 】
发信人: Teazeejay (TeaZJ), 信区: Database
标 题: Recruiting Senior Java developer for investment bank. (based in China, paid in US standard)
关键字: CHINA,JOB,JAVA,中国,工作
发信站: BBS 未名空间站 (Mon Apr 1 01:29:06 2013, 美东)
Hi talents,
身在异乡为异客,希望回祖国工作并且手持高薪的人才们注意啦。世界百强投行寻找资
深Java开发专员,工作地点为中国大陆北方一线城市,薪资按美国标准发放。详细信息
如下:
UK-based investment bank is looking for senior Java developer. The job is
based in China, but paid in US standard. Following is the job description:
A software engineer wit... 阅读全帖
V*******j
发帖数: 2
7
身在异乡为异客,希望回祖国工作并且手持高薪的人才们注意啦。世界百强投行寻找资
深Java开发工程师,工作地点为中国大陆北方一线城市,薪资按美国标准发放。详细信
息如下:
UK-based investment bank is looking for senior Java developer. The job is
based in China, but paid in US standard. Following is the job description:
A software engineer with the relevant domain and platform technical
experience to facilitate product pricing and risk analysis functionality
initiatives for the Bank.
• Experienced Capital Market developer with previous experience in
the end-to-end design, ... 阅读全帖
m******i
发帖数: 6971
8
谢谢。看来跟四代破的差不多,两年有效,但第二年得花够钱才能保障第三年的。
n order to qualify for Premier Silver status, you must have $2,500 in
qualifying purchases in the calendar year. This process starts over again
every year on January 1.
If you do not requalify for Premier Silver status in the second or
subsequent year, your status will expire at the end of February in the third
or subsequent calendar year, and you will become a standard Reward Zone
member.
v****s
发帖数: 334
9
【 以下文字转载自 Military 讨论区 】
发信人: zaosen (leng), 信区: Military
标 题: 今天波士顿游行现场长篇演讲。。。巨牛 (转载)
发信站: BBS 未名空间站 (Sat Nov 9 01:21:20 2013, 美东)
发信人: zaosen (leng), 信区: Texas
标 题: 今天波士顿游行现场长篇演讲。。。巨牛
发信站: BBS 未名空间站 (Sat Nov 9 01:17:25 2013, 美东)
What a Journey
Chunyan Li, Ph.D.
11/8/2013
Dear all,
How long does it take us to get here today? One hour? Two hours? For me, it
is 20 years! 20 years ago I arrived at this land of the free, full of ideals
, perhaps from listening too much to radio Voice of America... 阅读全帖
l********g
发帖数: 400
10
http://thedailydrill.wordpress.com/2013/01/09/top-10-reasons-be
Top 10 Reasons Being a University Professor is a Stressful Job
By thisiskris18
Being a university professor is in no way the least stressful job for 2013.
In fact, 2013 is likely to be one of the worst years to be a university
professor.
But many pixels are being spent across the Forbes.com platform at the site
of Forbes staff columnist, Susan Adams. Adams has been a legal affairs
columnist at Forbes since 1995 and writes widely on ... 阅读全帖

发帖数: 1
11
来自主题: Faculty版 - Jan's lab : 这里有弟子么?

Download pdf published by SfN (Chapter from 'The History of Neuroscience in
Autobiography, Volume 8' edited by Larry R. Squire)
Yuh-Nung Jan's CV
Lily Jan's CV
Yuh-Nung Jan and Lily Jan
Birth
Family History and Growing Up
National Taiwan University
The Hiking Trip to Shitou in the Spring of 1967
Graduate School Application
Graduate Study at Caltech (1968锟974)
Seymour Benzer Lab (1974锟977)
Steve Kuffler锟絪 Lab at H... 阅读全帖
i**a
发帖数: 231
12
【 以下文字转载自 USANews 讨论区 】
发信人: idoa (weiming), 信区: USANews
标 题: "What a Journey" - A powerful speech by Dr. Chunyan Li during NYC demonstration
发信站: BBS 未名空间站 (Sun Nov 10 08:02:54 2013, 美东)
"What a Journey" - A powerful speech by Dr. Chunyan Li, a devoted mother,
during an demonstration outside ABC Headquarters in New York City on Nov 8,
2013 protesting ABC Kimmel's racial hatred skit targeting the Chinese and
Asian community
纽约游行演讲全文(what a journey)
如果能够感动你,请转发
Click "Like" and forward along if ... 阅读全帖
r*******g
发帖数: 1335
13
来自主题: JobHunting版 - Google onsite问题
everyone knows how to solve the problems?
1. Compute the quotient and remainder of m/n, without using division
operator.
我会用二分法找到商a,a是第一个使m-n*a>0的数,减去a这个部分,再继续找。
2. Given a set of coin denominators, find the minimum number of coins to
give a certain amount of change.
貌似用dp?从要求得到的值向下dp还是从0开始向上dp?这样的题一直没弄明白怎么做
最好。
3. Given an array,
i) Find the longest continuous increasing subsequence.
ii) Find the longest increasing subsequence.
这道题怎么解??谢谢了,google出来发现并不简单。
4. A building of 100 floors, there is a... 阅读全帖
i*******h
发帖数: 216
14
来自主题: JobHunting版 - Google onsite问题
?????:
1.repeat m-n until the result is smaller than n, also count how many repeats.
2.Assume that we have 1 cent denominator. This is reasonable, why? :)
sort the denominators array in reversed order.
int count=0
for each denominator[i]
{
count += sum/denominator[i];
sum = sum%denominator[i];
}
3.1
int max=0;
int count=0;
int old=a[0];
for(int i=1;i {
if(a[i]>old)
count++;
else
{count=0;
if(max max=count;
}
old = a[i];
}
3.2
This is a classi... 阅读全帖
i*******h
发帖数: 216
15
来自主题: JobHunting版 - Google onsite问题
?????:
1.repeat m-n until the result is smaller than n, also count how many repeats.
2.Assume that we have 1 cent denominator. This is reasonable, why? :)
sort the denominators array in reversed order.
int count=0
for each denominator[i]
{
count += sum/denominator[i];
sum = sum%denominator[i];
}
3.1
int max=0;
int count=0;
int old=a[0];
for(int i=1;i {
if(a[i]>old)
count++;
else
{count=0;
if(max max=count;
}
old = a[i];
}
3.2
This is a classi... 阅读全帖
g*******y
发帖数: 1930
16
来自主题: JobHunting版 - 微软面试题一道
你先给interleaving定义一下?
我做的算法课的作业题里面,interleaving的定义是,string的一个subsequence是A的
repeation,剩下的subsequence是B的repeation
repetion的定义是:
ABC的repetion就是ABCABCABC...ABC + '空/A/AB'

one.
s*********l
发帖数: 103
17
来自主题: JobHunting版 - 寻找子序列/子段落
http://fayaa.com/tiku/view/167/
问题1:
给定两个序列A和B(A,B可以是字符串,也可以是其它类型的一维数组),求B中最短的包
含A的子序列(i.e. the shortest subsequence of B which is the supersequence of
A)。这里'包含'的意思指被包含的
序列(subsequence)可以由包含序列(supersequence)删除一些位置上的元素而得到,而
且顺序必须保持一致。
比如对输入
A: 'hello world'
B: 'hello our world hello my world'
输出应为'hello my world'.
另外当A固定,而B变化巨多或者B固定而A变化居多时应如何处理以提高性能?
问题2:
给定一段文本text和一些关键字集合keywords,求文本text中包含所有keywords的最短
子段落。这里
关键字出现的顺序不重要。比如对输入
text: 'hello our world hello my world'
pattern: {'hello','world'}
x******3
发帖数: 245
18
来自主题: JobHunting版 - 问一道简单DP题
没看懂你的解法,
比如这段程序,
if(DiffArray[i]*DiffArray[i+1] < 0)
你只是判断相邻的三个元素是不是zig zag,
但是longest zz subsequence里的元素不一定要相邻
能说下你的subproblem space是什么吗
我的subproblem定义是
给定序列A[1..n]
LCCZ(i) = the length of longest ZZ subsequence ending at A[i]
原题的解LCCZ(A) = max(A[i]) 1<=i<=n
b********h
发帖数: 119
19
来自主题: JobHunting版 - Maximum Sum of Increasing Sequence
subsequence不是subarray吧。bruteforce应该是2^n。
DP的做法跟max subsequence一样,定义S(i)为在i结束的max increaseing sequence,
则,
S(i) = max{S(j)+A[i], A[i]>A[j] && 0<=j
s********e
发帖数: 28
20
来自主题: JobHunting版 - Amazon Summer Intern Offer, 发面经
I agree! 我也一直有这个疑问。
不管楼主说的是找longest common substring or longest common subsequence in
string and reversed string, 在下面这个例子中都是不对的。There is NO
palindrome in "abcXYZcba", however the longest common substring is abc or
cba, the longest common subsequence is abcXcba, or abcYcba, or abcZcba.
suffix tree 的解法也有这个问题。这是我长久以来的疑问,难道是我对palindrome的
理解有误?可以不连续?
哪位大侠给解答一下?
s*****y
发帖数: 897
21
来自主题: JobHunting版 - one amazon interview problem
thanks
的确不work,考虑不周全。
By the way,这个subsequence就是要不要连续的啊?subarray是连续的,subsequence是不是也要连续?
s*****y
发帖数: 897
22
来自主题: JobHunting版 - one amazon interview problem
我觉得subsequence不需要连续阿
不然这题为什么叫做subsequence阿
http://www.algorithmist.com/index.php/Longest_Increasing_Subseq
我是因为看了楼上有个c的解法似乎就是求不连续的,没有人出来指正一下,所以迷惑。
j*****g
发帖数: 223
23
总结一下面试的准备活动,希望有帮助.
==================== AREAS/TOPICS to study/prep/review ====================
复习的东西还挺多的。比不过刚毕业的呀 :), 脑子不好使了,东西也差不多忘光了...
嘿嘿....
• Sorting
o Bubble/select/insertion/counting/qsort/heap/merge/bst
o Time/space complexity analysis
• Caching design
o Replacement policy (LRU, LFU, NRU, etc…)
o Efficiency/complexity/performance
o Distributed cache
o Hashing
• Multi-thread
o Locking/mutex/semaphore/critical sec... 阅读全帖
j*****g
发帖数: 223
24
总结一下面试的准备活动,希望有帮助.
==================== AREAS/TOPICS to study/prep/review ====================
复习的东西还挺多的。比不过刚毕业的呀 :), 脑子不好使了,东西也差不多忘光了...
嘿嘿....
• Sorting
o Bubble/select/insertion/counting/qsort/heap/merge/bst
o Time/space complexity analysis
• Caching design
o Replacement policy (LRU, LFU, NRU, etc…)
o Efficiency/complexity/performance
o Distributed cache
o Hashing
• Multi-thread
o Locking/mutex/semaphore/critical sec... 阅读全帖
c******a
发帖数: 789
25
来自主题: JobHunting版 - 最长递增子array的算法
There's also an O(nlogn) solution based on some observations. Let A{i,j} be
the smallest possible tail out of all increasing subsequences of length j
using elements {a1, a2, a3, ..., ai}.
Observe that, for any particular i, A{i,1} < A{i,2} < ... < A{i,j}. This suggests that if we want the longest subsequence that ends with a i + 1, we only need to look for a j such that Ai,j < ai + 1 < = Ai,j + 1 and the length will be j + 1.
Notice that in this case, Ai + 1,j + 1 will be equal to ai + 1, and al... 阅读全帖
a****g
发帖数: 54
26
来自主题: JobHunting版 - 面试问题,最长翻转整数问题
Dynamic programming
subsequence(i,j) = subsequence(i+1, j-1) + 2
s*****y
发帖数: 897
27
来自主题: JobHunting版 - 问个算法题5
看了各位大牛的实现后,写了个O(nlgk)的C实现
#include
#include
//assume input array size < 20
#define ARRAY_SIZE 20
/*P[k] —stores the position of the
predecessor of X[k] in the longest increasing subsequence ending at X[k].*/
static int P[ARRAY_SIZE];
/*M[j] stores the position k of the smallest value X[k]
such that there is an increasing subsequence of length j ending
at X[k] on the range k ≤ i (note we have j ≤ k ≤ i here)*/
static int M[ARRAY_SIZE];
void Find_Lis(int input[], int size, int... 阅读全帖
s*****y
发帖数: 897
28
来自主题: JobHunting版 - 问个算法题5
concentrate on the definitoin of these two arrays:
M[j] — stores the position k of the smallest value X[k] such that there
is an increasing subsequence of length j ending at X[k] on the range k ≤ i
(note we have j ≤ k ≤ i here).
P[k] — stores the position of the predecessor of X[k] in the longest in
creasing subsequence ending at X[k].
Then you will know what the binary search for.
r********r
发帖数: 2912
29
来自主题: JobHunting版 - careerup 150 上一道题 答案没看懂?
I think the solution is wrong. The longest subsequence algorithm given on
wikipedia works.
For instance, the sequence is
40 70 50 60
Starting from 40, the solution can only detect two increasing subsequence
40 70 and 50 60 that are not longest

atop
person
the
compute
,
r********r
发帖数: 2912
30
来自主题: JobHunting版 - careerup 150 上一道题 答案没看懂?
I think the solution is wrong. The longest subsequence algorithm given on
wikipedia works.
For instance, the sequence is
40 70 50 60
Starting from 40, the solution can only detect two increasing subsequence
40 70 and 50 60 that are not longest

atop
person
the
compute
,
b**********2
发帖数: 1923
31
来自主题: JobHunting版 - 帮我看看这两个题目回答
3. Write a C++ program that would find and print the first longest
ascending or descending subsequence for a vector of integers. For example,
given a vector with
4, 2, 1, 2, 3, 4, 3, 5, 1, 2, 4, 6, 5
the program would find the underlined subsequence and print it.
void printLongestConsecAsending (vector& seq) {
unsigned int i=0;
unsigned int best_start = 0, best_length=1;
unsigned int current_start = 0, current_length=1;
while (i < seq.size()) {
if (seq[i++] > s... 阅读全帖
l*********y
发帖数: 142
32
来自主题: JobHunting版 - 问一道multiset的题
第一次用multiset,不知道怎么用
题目应该很简单的,蛮力排序的话会超时。
网上的评论是
Easy. Don't use cin or cout and you could use a multiset :)
实在无语。没想出怎么用multiset。
谁给解释一下。谢谢了!
Problem H: Hoax or what
Each Mal-Wart supermarket has prepared a promotion scheme run by the
following
rules:
* A client who wants to participate in the promotion (aka a sucker) must
write down their phone number on the bill of their purchase and put the
bill into a special urn.
* Two bills are selected from the urn at the end of each day: first the
... 阅读全帖
i***0
发帖数: 8469
33
来自主题: JobHunting版 - 大家来讨论一下c++吧
大家来讨论一下c++吧
Please answer the following c++ questions. Do not simply answer yes/no.
Always explain your assumptions and reasoning.
1. memset is sometimes used to initialize data in a constructor like the
example below. What is the benefit of initializing this way? Does it work
in this example? Does it work in general ? Is it a good idea in general?
class A {
public:
A();
private:
int a;
float f;
char str[35];
long *lp;
};
A::A()
{
... 阅读全帖
b*******y
发帖数: 232
34
来自主题: JobHunting版 - fb电面第一轮
longest increasing subsequence吧
不在其列的就是需要删掉的
然后可以找出多个longest increasing subsequence

re
p*******o
发帖数: 3564
35
来自主题: JobHunting版 - 问一A家题目
www.careercup.com/question?id=11978701f
Given an array of integers, find the longest subsequence of elements which
monotonically increases. for ex. array = {1 4 8 2 5 7 3 4 6}, the longest
subsequence = {1 2 3 4 6}
I have explained him about O(N^2) with O(1) space algorithm but the
interview is expecting O(N log N). Could any one help me explaining the
algorithm in detail ?
t******n
发帖数: 354
36
来自主题: JobHunting版 - 悲捶,问了小秘后,offer letter变了
I am pleased to offer you the position. Your initial salary will be $zzz per month, which is equivalent to $zzzz annually. This offer is contingent upon satisfactory reference and applicable background/motor vehicle checks and confirmation that you are legally authorized to work in the United States.
You will be considered a probationary employee during your first six (G) months of employment. Your first performance review wiil be prior to the end ofthe probationary period. Subsequent rev... 阅读全帖
l*******b
发帖数: 2586
37
来自主题: JobHunting版 - Leetcode problems' difficulty
另外各种限制条件很难写的题目感觉不会写
Restore IP Addresses
Wildcard Matching
Word Search
Sudoku两个题费了老大劲写完了,有140多行,汗
Scramble String
Distinct Subsequences
这两个DP的也没治,感觉比longest common subsequence, edit distance这类难多了
h**h
发帖数: 298
38
关于H1B,USCIS上的这段话什么意思?
A Duplicate Copy of the H-1B Petition
You must submit a duplicate copy of your H-1B petition and any subsequent
response to a Request for Evidence or Notice of Intent to Deny (where
applicable) if the beneficiary will be applying for a nonimmigrant visa
abroad. USCIS will not make a second copy if one is not provided.
You may also choose to submit a duplicate copy of the petition with any
subsequent response to a Request for Evidence or Notice of Intent to Deny (
where appl... 阅读全帖
s**x
发帖数: 7506
39
来自主题: JobHunting版 - 问一道面试题
Solution 2:
O(n log k) algorithm. K is the length of We have elements.
Assume we already have an increasing sequence: A1, A2, A3, …., for any
given element E, we either
can simply append E to make the list longer,
Do a binary search to find a position j such that A[j] < E < A[j+1], update
A[j+1] to E, so A[1..j+1] can get longer later with new element.
Another list P is used to stores the position of the predecessor element
in the longest increasing subsequence.
#include
using namesp... 阅读全帖
r*********n
发帖数: 4553
40
来自主题: JobHunting版 - Yahoo! onsite 面经
国女问的题应该是increasing subsequence吧,如果是increasing subarray,最优解
法是O(n),如果是subsequence,最优是O(nlogn)吧
wiki上面有一个O(nlogn)的解法,但是需要两个auxiliary arrays,而且index套index
的,看起来不好理解。其实面官提示用BST是对的。
整个算法的outer loop是DP的思想,inner loop的思想是在array elements seen so
far里面做binary search找到new element的位置,但是要一边BS,一边update 这个
array,所以用binary search tree (balanced)。
p*u
发帖数: 136
41
来自主题: JobHunting版 - 分享2个电面题目
电面imo.im被问到的2个题目,45分钟,都需要写代码出来,结果是挂了。
问题二略微有点变态!
问题一
Subsequences
------------
You're given a large string T. And a stream of smaller string S1, S2, S3 ...
Determine whether Si is a subsequence of T.
|T| < 10 000 000
|Si| < 100
alphabet is 'a' - 'z'
T = abcdefg
S1 = abc yes
S2 = ag yes
S3 = ga no
S4 = aa no
--------------
问题二
Rectangles
----------
their is a window of size WxH contains Number of existing rectangles with
given (xi, yi, wi, hi).
Where to place a n... 阅读全帖
s********u
发帖数: 1109
42
嗯,我好像理解你的意思了。
就像这一段(维基百科):
In other words, a greedy algorithm never reconsiders its choices. This is
the main difference from dynamic programming, which is exhaustive and is
guaranteed to find the solution. After every stage, dynamic programming
makes decisions based on all the decisions made in the previous stage, and
may reconsider the previous stage's algorithmic path to solution
一个简单的例子是,找硬币的问题,比如硬币面值是1,3,4.要组成6,贪心法就会得到(
4,1,1),而dp则能解出(3,3)。
但我奇怪的是,如果按照这样的说法,我们平时绝大多数的dp题,难道实际上都是贪心
算法了。(或者把贪心... 阅读全帖
l********7
发帖数: 40
43
来自主题: JobHunting版 - G onsite面经 加求blessing
刚面过G,从9月份电面到现在一共两个月把所有事情弄完。
电面只有一轮,出了一个之前版上出现过的题,一个string由0,1和?组成,并且?可
以被替换成0或者1,让输出所有的把?替换之后不同的string,比如1?0把?替换之后
能够生成110和100
之后过了三周才接到onsite的通知
onsite一共有4轮,中间午餐
第一轮一上来告诉我一个function的定义和它的功能,然后问了很多test的东西,我也
不懂,就瞎扯,之后让我实现这个function以及它的一个变种,类似就是一个array of
integer,以及一个int,这个int表示一个window的宽度,这个window从array的一开
始滑动到最后,找出来在滑动的过程中每次window中int的和,比如一个array是[1,2,3
,4,5],然后window的宽度是2,那么就输出[3,5,7,9]
第二轮是给一个int N,让输出所有的长度为N的valid string的个数,valid string的
定义是由A,B,C三种字母组成,并且在这个string中任意连续的三个字母不能包括A,B,C
三个字母,比如... 阅读全帖
t*****y
发帖数: 25
44
来自主题: JobHunting版 - G onsite面经 加求blessing
同迷惑:什么叫continuous subsequence sum? 是两个index之前所有元素的和吗?
我的解法是两个pointer, 一个st 一个en,
int st = 0;
int en = -1;
int count = 0;
while(en < A.length){
// move en forward
while(count < low){
en++;
count += A[en];
}
while(count <= high){
addSequence(A,st,en);
en++;
count += A[en];
}
// move st forward
while(count > high){
count -= A[st];
st++;
}
while(count >= low){
addSequence(A,st,en);
st++;
count -= A[st];
... 阅读全帖
r****s
发帖数: 42
45
来自主题: JobHunting版 - G 家店面 找到missing number变种
用StringBuffer 做,StringBuffer在增长,同时与原string的前i位比较内容,一出现
不相等的,就找到了位置。我简单写了个,先考虑0-99以内的:100-999,类似吧,多
加个else if
StringBuffer sb=new StringBuffer(); String string="
0123456789101112131415161718192022";
int m=1;
for(int i=0;i sb.append(i);
if(i<10){
if(! sb.toString().equals(string.subSequence(0, i+1))){
System.out.println("result: "+i);break;
}
}

... 阅读全帖
h**6
发帖数: 4160
46
来自主题: JobHunting版 - 被简单题给虐了。
多维空间时,分别对每一维坐标排序,得到M个数组,把其中一个数组标为1,2,3...n,
别的数组与之求longest common subsequence可以转化为longest increasing
subsequence,最终复杂度O(Mnlog(n))。
m*****n
发帖数: 9
47
来自主题: JobHunting版 - 发个G店面的题目
subsequence里的数要从小到大一个接一个吗?
是的,数字要一个接一个。2,3,4,5就是连接着的。
就是找一个数的adjacent elements,然后看这些adjacent elements有几个相邻的。比
如数字8的adjacent elements就是2,3,4,5(上下左右),然后这些数连着的数字就是4
个,所以长度是4.
比如4的adjacent elements就是8,9,11,14,然后连着的数字就是8和9,所以长度是2.
=======================================
不是很懂题目。
subsequence里的数要从小到大一个接一个吗?
还有,2,3,4,5只是角相邻而不是边相邻,这样也可以吗?
f*****u
发帖数: 308
48
说错了,不是substring,是subsequence,longest common subsequence,经典的dp问
题。
r****m
发帖数: 70
49
来自主题: JobHunting版 - DP通项公式
有朋友提到不知道怎么做DP的题目,分享一下自己的总结,希望对大家有帮助。
1. Distinct Subsequence (String S, String T)
F(i, j) = F(i-1, j) , S[i] != T[j]
F(i-1, j) + F(i-1, j-1) , S[i] ==T[j]
2. Longest Common Subsequence (String S1, String S2)
F(i, j) = F(i-1, j-1) + 1, S[i] == T[j]
Max{ F(i-1, j), F(i, j-1) }, S[i] !=T[j]
LCS可以把空间复杂度O(n^2)减少到O(n),因为第n步的DP只 和前一步(第n-1步)的
最优子结果有关 F(n) = F(n-1)
3. Edit Distance (String S1, String S2)
F(i, j) = Min { F... 阅读全帖
r****m
发帖数: 70
50
来自主题: JobHunting版 - DP通项公式
有朋友提到不知道怎么做DP的题目,分享一下自己的总结,希望对大家有帮助。
1. Distinct Subsequence (String S, String T)
F(i, j) = F(i-1, j) , S[i] != T[j]
F(i-1, j) + F(i-1, j-1) , S[i] ==T[j]
2. Longest Common Subsequence (String S1, String S2)
F(i, j) = F(i-1, j-1) + 1, S[i] == T[j]
Max{ F(i-1, j), F(i, j-1) }, S[i] !=T[j]
LCS可以把空间复杂度O(n^2)减少到O(n),因为第n步的DP只 和前一步(第n-1步)的
最优子结果有关 F(n) = F(n-1)
3. Edit Distance (String S1, String S2)
F(i, j) = Min { F... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)