Redian新闻
>
F1能在美国注册公司吗
avatar
F1能在美国注册公司吗# Law - 律师事务所
j*e
1
【 以下文字转载自 EB23 讨论区 】
发信人: jzsublease (mingming), 信区: EB23
标 题: 申请政治庇护后,可否再申请杰出人才? (转载)
发信站: BBS 未名空间站 (Sat Nov 9 15:44:15 2013, 美东)
发信人: jzsublease (mingming), 信区: Immigration
标 题: 申请政治庇护后,可否再申请杰出人才?
发信站: BBS 未名空间站 (Sat Nov 9 15:43:27 2013, 美东)
杰出人才要1-2年准备才有可能,先政治庇护维持身份 可以吗?
1-2年内基本也不会被赶走吧
avatar
l*i
2
坏X 5(坏坏坏坏坏)
70后的歌也很后现代嘛
avatar
x*h
3
忘记叫啥名字了
avatar
b*e
4
Given a list of strings, find a concatenation of all the strings such that
its dictionary order is the smallest among all the possibilities.
For instance, by joining the list ["ab", "cd", "ef"] we can get:
"abcdef",
"cdabef",
"cdefab",
..., ...
where "abcdef" is the one of the least dictionary order.
avatar
a*i
5
以前实体店和制造业,说是被马云的淘宝给打击了,但是现在又说,被拼多多给打击了。
于是乎人们议论纷纷,说淘宝和拼多多,其实有个共同点,那就是都有很多的假货,因
为是假货,是山寨品,所以很便宜,比如各种名牌服装的高仿,还有一些奢侈品包包的
高仿,一些用品的高仿等等,冲击了真货。
但是马老板有一句话说的挺有道理,“假货的质量,其实也很不错嘛”。
这句话我赞同一半,我也从淘宝买过很多年的东西了,涉及到吃穿住用行,确实也淘到
过不少好东西,价格便宜的高仿,但是物超所值,用起来,也没有比真品差哪去,一点
都不影响使用,甚至用了很多年,也还很好,包括衣服,都是如此,所以假货不一定都
是垃圾。
拼多多现在也是这样的情况,因为东西便宜,虽然有些是挺垃圾的质量差,但是也有可
以正常使用的,所以人们还是买,重点就是俩字“便宜”!
这个就是我题目说的理由,因为中国的经济这些年不太好,房价又这么高,“便宜”就
是最大的理由了,美国其实也是如此,美国中产和穷人,也很喜欢中国制造的廉价货。
avatar
w*n
6
这几天以前投的一个会议的program committee要求对reviewer的意见进行回答和解释
。所有的review都可见,一共五个,评价上有一个建议reject,说我们的东西别人做过
了,但实际上还是有不同,而且我们这次投的内容只是我们一个大project的前期,几
个小的不同点,在后期还会起到承前启后的放大作用;其他的都没有直接说要收,有两
个对我们的结果表示很满意,也有些疑问;有一个指出了我们的研究方法的一个独创点
;还有一个对模拟方法表示了疑问,认为可能有bug。
对于提出reject意见的reviewer,因为相关领域的研究者还是很多,我需要说明这点不
同对于我们将来研究方向的基石作用吗?我们将来研究的东西可以基本上肯定没人做过
,说出来之后会不会被人给利用了呢?
总体我的感觉就是被收的可能性较低,哪位仁兄有过类似经验吗?请指教
avatar
s*n
7
F1规定是不能工作的,但是可以在美国注册公司吗?只当投资者。
avatar
l*i
8
用说谎话换绿卡的“杰出”人才?
avatar
x*h
9
柯南也出了
avatar
b*u
10
排序?

【在 b***e 的大作中提到】
: Given a list of strings, find a concatenation of all the strings such that
: its dictionary order is the smallest among all the possibilities.
: For instance, by joining the list ["ab", "cd", "ef"] we can get:
: "abcdef",
: "cdabef",
: "cdefab",
: ..., ...
: where "abcdef" is the one of the least dictionary order.

avatar
h*n
11
图便宜,说明大家还是穷
avatar
t*t
12
can you submit the paper with new results to another conference in the
future? I think most publications require 'significant' contribution.if u
dont have to publish in this conference and dont want to reveal more
information about the ongoing project either, you might just keep working on
the project and publish a much better paper later.
avatar
y*i
13
好像可以
avatar
O*y
14
能保持身份的种类挺多,你申请个薄厚也行吧,到时候再申请杰出人才也来得及。你申
请政治庇护就要说zf迫害你,现在二胎也放开了,法轮功蒙老美也不灵了。一旦政治庇
护deny你就要递解出境得不偿失得很。就算政治庇护申请下来你一辈子就别回国了,这
样多不合算
avatar
k*g
15
ms 还是很低幼,ld 看过了,我还没有看

【在 x******h 的大作中提到】
: 柯南也出了
avatar
b*e
16
The question is: how?

【在 b******u 的大作中提到】
: 排序?
avatar
d*m
17
we just poor boys, we live in fantasy

【在 h******n 的大作中提到】
: 图便宜,说明大家还是穷
avatar
w*n
18
多谢啦!老板把我写的关于以后的工作的内容删掉了,他也说即使不中,咱们还有以后
的机会
avatar
n*6
19
可以的.
成立公司没有身份限制
具体情况你可以发信给你所在州的主管部门询问
avatar
j*e
20
你这么说意思是可以庇护以后在杰出人才? 申请到绿卡可以回国的 我认识的 没事的
。没法博后。

【在 O*********y 的大作中提到】
: 能保持身份的种类挺多,你申请个薄厚也行吧,到时候再申请杰出人才也来得及。你申
: 请政治庇护就要说zf迫害你,现在二胎也放开了,法轮功蒙老美也不灵了。一旦政治庇
: 护deny你就要递解出境得不偿失得很。就算政治庇护申请下来你一辈子就别回国了,这
: 样多不合算

avatar
z*m
21
再见了,露琪亚?
出在哪儿了?

【在 x******h 的大作中提到】
: 忘记叫啥名字了
avatar
b*u
22
如果输入很大,建个树之类的,每条边是一个字母,然后做一个遍历

【在 b***e 的大作中提到】
: The question is: how?
avatar
d*m
23
我的确是被震撼到了
avatar
O*n
24
states don't care. but you cannot work for the co.(even without pay) without
authorization from INS.
avatar
j*e
25
没说谎 也不太可能那到庇护绿卡 只是用来保持身份...

【在 l**i 的大作中提到】
: 用说谎话换绿卡的“杰出”人才?
avatar
x*h
26
好象是,bt到处都是下的
总队长就是剑八+解放

【在 z*******m 的大作中提到】
: 再见了,露琪亚?
: 出在哪儿了?

avatar
b*e
27
You just didn't get it.
I am not asking a trivial question that you can have an answer within 2 mins
without knowing the answer already. If you do, there are only 2
possibilities:
1. you are Einstein, or
2. you are wrong.
I know Einstein never came (and will never come) to this BBS. So there's
only 1 option for you.
Please, give it some serious thinking before you reply.

【在 b******u 的大作中提到】
: 如果输入很大,建个树之类的,每条边是一个字母,然后做一个遍历
avatar
d*m
28
my goodness
avatar
s*n
29
thanks.
avatar
O*y
30

如果你一定要庇护拿绿卡,那么拿到绿卡就不用再整杰出人才。绿卡都是一样的,你只
要最后入了籍就successful了。你来美国超过一年了么,超过一年没法申请庇护。有人
运气好申请到庇护绿卡回来的时候在边境没被没收,但是遇到个较真的移民官多半要收
回绿卡。你能走F-1,H-1吗?虽然比较艰辛但是还靠谱些。
你最好咨询律师,觉得这个论坛你这种情况非常少

【在 j********e 的大作中提到】
: 你这么说意思是可以庇护以后在杰出人才? 申请到绿卡可以回国的 我认识的 没事的
: 。没法博后。

avatar
z*k
31
不是个Einstein问题,就是个排序问题.
avatar
m*n
32
便宜和假货不是一个概念,请不要混淆视听
便宜、低配不是错,只要能堂堂正正的标明,没人有权批评
假货的问题在于明明低配甚至质量都不过关,却要冒充正牌
avatar
s*n
33
thanks.
avatar
m*e
34
不觉得很萎缩么?人活着应该知道有所为有所不为吧
avatar
h*r
35
easy.
cat your-list | sort | concat
done.

【在 b***e 的大作中提到】
: Given a list of strings, find a concatenation of all the strings such that
: its dictionary order is the smallest among all the possibilities.
: For instance, by joining the list ["ab", "cd", "ef"] we can get:
: "abcdef",
: "cdabef",
: "cdefab",
: ..., ...
: where "abcdef" is the one of the least dictionary order.

avatar
n*n
36
人家正牌先把市场做了,他们搭车,当然能便宜些。

【在 m*****n 的大作中提到】
: 便宜和假货不是一个概念,请不要混淆视听
: 便宜、低配不是错,只要能堂堂正正的标明,没人有权批评
: 假货的问题在于明明低配甚至质量都不过关,却要冒充正牌

avatar
l*i
37
有些人不知道,底线比他自己的脚底板还低

【在 m*****e 的大作中提到】
: 不觉得很萎缩么?人活着应该知道有所为有所不为吧
avatar
X*r
38
Let me try it. I definitely spent more than two minutes, but it
doesn't mean I'm right though.
Assume the strings are s_i, we are going to find k so that s_k is the
first string in the concatenated result.
a j while sum_i(len(s_i)) > j:
c if there is single minimal c from s_k:
break
else:
a discard all s_i that s_i[j] != c from further consideration
j++
if k is still undecided:
pick any k

【在 b***e 的大作中提到】
: You just didn't get it.
: I am not asking a trivial question that you can have an answer within 2 mins
: without knowing the answer already. If you do, there are only 2
: possibilities:
: 1. you are Einstein, or
: 2. you are wrong.
: I know Einstein never came (and will never come) to this BBS. So there's
: only 1 option for you.
: Please, give it some serious thinking before you reply.

avatar
m*r
39
这从理论上说是有可能的,可以同步申请两种类型移民。如果你的确被国籍所在国迫害
,申请自然符合美国移民法律,但如果你的目的仅仅是保持身份,这是欺诈。你也会被
问起为什么同时申请两种。
avatar
b*e
40
Somewhat I expected a good one from you. And here we go.
This looks very promising, but man, you are going with a real operational
approach while I am looking for some sort of denotational explanation.
Nonetheless, here's the question (where I believe you have a typo):
by
if len(s_i) <= j, use a[len(s_i)-j] as s_i[j] // negative index?
do you really mean:
if len(s_i) <= j, use s[j-len(s_i)] as s_i[j]
There are further questions, but let's figure out the most essential one
first.
avatar
S*l
41
你来美国几年了?真皮必须一年之内申请

【在 j********e 的大作中提到】
: 没说谎 也不太可能那到庇护绿卡 只是用来保持身份...
avatar
i*e
42
最笨的办法:每个string建个链表,然后scoring串起来的string,慢慢排去。。。
avatar
f*u
43
只要在最后一次入境后一年内就行

【在 S***l 的大作中提到】
: 你来美国几年了?真皮必须一年之内申请
avatar
X*r
44
Actually I meant a[j-len(s_i)] as s_i[j] for len(s_i) <= j
where a is the best concatenated string built so far.
Okay let me explain what I'm thinking. Obviously if all strings
are of the same length we can just simply sort them. However
for shorter strings we need to fill the blanks with the characters
that from the best concatenated string built without this
particular shorter string in question. Given that we needed to
compare characters up to this position so far, which means there
is at lea

【在 b***e 的大作中提到】
: Somewhat I expected a good one from you. And here we go.
: This looks very promising, but man, you are going with a real operational
: approach while I am looking for some sort of denotational explanation.
: Nonetheless, here's the question (where I believe you have a typo):
: by
: if len(s_i) <= j, use a[len(s_i)-j] as s_i[j] // negative index?
: do you really mean:
: if len(s_i) <= j, use s[j-len(s_i)] as s_i[j]
: There are further questions, but let's figure out the most essential one
: first.

avatar
m*8
45
sort with criterion str1 < str2 if str1 + str2 < str2 + str1.
avatar
b*e
46
Clever!
However, not the end of the story. Why is your ordering well defined? In
other words, sorting according to your order will terminate.
Let me give concrete example: we all know sissor/paper/stone. There is a
overcoming relation among them, but that relation is not an well-defined
ordering, because there is a infinite descending sequence:
...< paper < sissor < stone < paper
To justify your answer, you need to justify we can do sorting with the
relation you defined. In other words, is t

【在 m**********8 的大作中提到】
: sort with criterion str1 < str2 if str1 + str2 < str2 + str1.
avatar
b*e
47
Yes. I believe the algorithm works.
But the real question is, how do you convince us why your algorithm will
give the optimal, i.e., can you sketch a proof why by your operations an
optimal can be reached. I do not see a trivial argument here.
See, here's why I like this problem. It is not hard to derive an
algorithm that you so much believe is correct, but it is truly non-
trivial to justify why it is the case.

【在 X****r 的大作中提到】
: Actually I meant a[j-len(s_i)] as s_i[j] for len(s_i) <= j
: where a is the best concatenated string built so far.
: Okay let me explain what I'm thinking. Obviously if all strings
: are of the same length we can just simply sort them. However
: for shorter strings we need to fill the blanks with the characters
: that from the best concatenated string built without this
: particular shorter string in question. Given that we needed to
: compare characters up to this position so far, which means there
: is at lea

avatar
X*r
48
Hmm interesting, I had thought of this but just didn't think it
would be a total order. But upon a closer look it is quite obvious:
assume the size of character set is n, then all strings can be mapped
to numbers in base n. Denote x(s) as the number for string s, and l(s)
as its length, ab <= ba then is as same as
x(a)*n^(l(b)) + x(b) <= x(b)*n^(l(a)) + x(a)
which is equivalent to
x(a)/(n^(l(a))-1) <= x(b)/(n^(l(b))-1)
so obviously it is transitive. The above means that you may as well
repeat th

【在 b***e 的大作中提到】
: Clever!
: However, not the end of the story. Why is your ordering well defined? In
: other words, sorting according to your order will terminate.
: Let me give concrete example: we all know sissor/paper/stone. There is a
: overcoming relation among them, but that relation is not an well-defined
: ordering, because there is a infinite descending sequence:
: ...< paper < sissor < stone < paper
: To justify your answer, you need to justify we can do sorting with the
: relation you defined. In other words, is t

avatar
b*e
49
Yes, so in fact the ordering is on s* rather than s. The algorithm you
gave somewhat does that.
After this understanding, we can have a dictionary tree to handle it in
a
linear order (of the number of characters).

【在 X****r 的大作中提到】
: Hmm interesting, I had thought of this but just didn't think it
: would be a total order. But upon a closer look it is quite obvious:
: assume the size of character set is n, then all strings can be mapped
: to numbers in base n. Denote x(s) as the number for string s, and l(s)
: as its length, ab <= ba then is as same as
: x(a)*n^(l(b)) + x(b) <= x(b)*n^(l(a)) + x(a)
: which is equivalent to
: x(a)/(n^(l(a))-1) <= x(b)/(n^(l(b))-1)
: so obviously it is transitive. The above means that you may as well
: repeat th

avatar
b*e
50
In fact, there's a meta question:
Why is an ordering relation important here? What breaks if there's no
transitivity or anti-symmetry?

【在 X****r 的大作中提到】
: Hmm interesting, I had thought of this but just didn't think it
: would be a total order. But upon a closer look it is quite obvious:
: assume the size of character set is n, then all strings can be mapped
: to numbers in base n. Denote x(s) as the number for string s, and l(s)
: as its length, ab <= ba then is as same as
: x(a)*n^(l(b)) + x(b) <= x(b)*n^(l(a)) + x(a)
: which is equivalent to
: x(a)/(n^(l(a))-1) <= x(b)/(n^(l(b))-1)
: so obviously it is transitive. The above means that you may as well
: repeat th

avatar
X*r
51
I'm not sure I understand your question here.
For strings a and b we define a relation a <= b iff ab <= ba in
dictionary order. This definition of the relation is useful later,
but only if the relation is a total order, because being a total
order is a necessary and sufficient condition of being able to
sort a finite set ascendingly, i.e. a bijection to [1,n].
(Strictly speaking we need to define equvalent classes to satisty
anti-symmetry)
If the strings can be sorted in s_1,..., s_n, using the

【在 b***e 的大作中提到】
: In fact, there's a meta question:
: Why is an ordering relation important here? What breaks if there's no
: transitivity or anti-symmetry?

avatar
b*e
52
It is a bit vague, I would say. Here is a more concrete version:
If I claim the following:
Define the relation "a < b iff ab < ba". Then based on the relation,
I repeat the simple operation of finding an adjacent pair of strings
of inverted order and swap them, until I cannot find any such pairs.
After all the swapping is done, I get the result.
Apparently, I didn't use transitivity in this argument. Why is the
argument defective without the discussion about transitivity?

【在 X****r 的大作中提到】
: I'm not sure I understand your question here.
: For strings a and b we define a relation a <= b iff ab <= ba in
: dictionary order. This definition of the relation is useful later,
: but only if the relation is a total order, because being a total
: order is a necessary and sufficient condition of being able to
: sort a finite set ascendingly, i.e. a bijection to [1,n].
: (Strictly speaking we need to define equvalent classes to satisty
: anti-symmetry)
: If the strings can be sorted in s_1,..., s_n, using the

avatar
X*r
53
What you have described only gets the local minimal, not the global
minimal required by the original question.

【在 b***e 的大作中提到】
: It is a bit vague, I would say. Here is a more concrete version:
: If I claim the following:
: Define the relation "a < b iff ab < ba". Then based on the relation,
: I repeat the simple operation of finding an adjacent pair of strings
: of inverted order and swap them, until I cannot find any such pairs.
: After all the swapping is done, I get the result.
: Apparently, I didn't use transitivity in this argument. Why is the
: argument defective without the discussion about transitivity?

avatar
b*e
54
Yes. This is part that interest me the most. In fact, anti-symmetry
guarantees that the swapping process will terminate, and transitivity
guarantees that local optimal is also global optimal. These 2 are necessary
for the correctness proofs.
From where I saw this problem, people reach the solution quickly, but had
quite some discussion on the correctness proof, where transitivity is the
key part.

【在 X****r 的大作中提到】
: What you have described only gets the local minimal, not the global
: minimal required by the original question.

avatar
h*r
55
do you have a counter example for the simplest sort + concatenate method?
thanks!

necessary

【在 b***e 的大作中提到】
: Yes. This is part that interest me the most. In fact, anti-symmetry
: guarantees that the swapping process will terminate, and transitivity
: guarantees that local optimal is also global optimal. These 2 are necessary
: for the correctness proofs.
: From where I saw this problem, people reach the solution quickly, but had
: quite some discussion on the correctness proof, where transitivity is the
: key part.

avatar
t*t
56
两个大侠讨论了这么久你还没看明白么.问题的重点就是怎么sort.
长度一样的,没问题,按字典序排
长度不一样的,多出来的部分怎么算
例1: "b" "bc" 结果="bbc"
例2: "b" "ba" 结果="bab"

【在 h***r 的大作中提到】
: do you have a counter example for the simplest sort + concatenate method?
: thanks!
:
: necessary

avatar
z*e
57
能不能这样?
Min_Order(A[1...N]) = (Min_Order(A[1...i-1, i+1...N]) insert A[i])
也就是说,最后排好的结果里面,随便抽一个出来,剩下的仍然是dictionary order,
问题是抽出来的这个应该怎么插回去,这个...呃, O(n)一个个试...
然后类似dynamic programming这样下去...
实际上我觉得还是先直接sort,比如{ab, a, acb, b,ba,bcc, ca, cb}
再怎么搞,排第一个的肯定是a开头的,对吧,按照上面的算法,剩下来的仍然是
dictionary order排最开头,不管怎么说, a**不会排到 b**后面去因为 a**(order{a*
*, b**, c**}),后面这个还是a**开头。
那么剩下就是把a**归一类比如a[...],对这个就是:
bool flags[...]; //全部false,这个用来记录a[i]是否已经用了
currentValue = a[0] + a[1]; //这个加起来是个linked list,方便后面插
flags[0]=fla

【在 t****t 的大作中提到】
: 两个大侠讨论了这么久你还没看明白么.问题的重点就是怎么sort.
: 长度一样的,没问题,按字典序排
: 长度不一样的,多出来的部分怎么算
: 例1: "b" "bc" 结果="bbc"
: 例2: "b" "ba" 结果="bab"

avatar
l*e
58
长度不一样的时候,可以这样比较:
假设len(s1[1:m]) < len(s2[1:n]),那么比较 s1[1:m] + s2[1:n-m]和s2[1:n]如果不
等,则可以排序;如果相等,则继续比较s1[1:m]+s2[1:n-m+i]和s2[1:n]+s1[1:i](
loop
i)直至n=m或者不等。
举例:
"b" "bc" => "bb" < "bc" => "bbc"
"b" "ba" => "bb" > "ba" => "bab"
"ab" "aba"=> "aba"=="aba" => "abab" > "abaa"=> "abaab"
"a" "aa" => "aa" == "aa" => "aaa"

【在 t****t 的大作中提到】
: 两个大侠讨论了这么久你还没看明白么.问题的重点就是怎么sort.
: 长度一样的,没问题,按字典序排
: 长度不一样的,多出来的部分怎么算
: 例1: "b" "bc" 结果="bbc"
: 例2: "b" "ba" 结果="bab"

avatar
h*r
59
字典排序呀,有什么问题。
反例呢 : ) 谢谢!

【在 t****t 的大作中提到】
: 两个大侠讨论了这么久你还没看明白么.问题的重点就是怎么sort.
: 长度一样的,没问题,按字典序排
: 长度不一样的,多出来的部分怎么算
: 例1: "b" "bc" 结果="bbc"
: 例2: "b" "ba" 结果="bab"

avatar
z*e
60
我想出一个排序的方法了:
关键问题是 "b" "ba"这种怎么判定,这不是长短问题,而是说如果一个是另一个的开
头部分:s2==s1+otherValue;
我的做法是把短的那个duplicate: "b" => "bb",直到两个长度相等(或者前者较大也
可以),然后再比较;
同样,如果是 "ad" "adc",那么"ad"=>"adad" 再比。总之:
s1
s2 = s1 s1 s1 others
then
temp = s1 s1 s1 s1;
compare s1 and s2;
写了段code如下:
bool Compare(string s1, string s2)
{
if (s1.length() < s2.length())
{

string temp = s1;
while(temp.length(){
temp+=s1;
}

return temp.compare(s2) < 0;
}
else if (s1.length() > s2.l

【在 t****t 的大作中提到】
: 两个大侠讨论了这么久你还没看明白么.问题的重点就是怎么sort.
: 长度一样的,没问题,按字典序排
: 长度不一样的,多出来的部分怎么算
: 例1: "b" "bc" 结果="bbc"
: 例2: "b" "ba" 结果="bab"

avatar
l*e
61
你这个错了
"ab"和"aba"怎么比的?

【在 z***e 的大作中提到】
: 我想出一个排序的方法了:
: 关键问题是 "b" "ba"这种怎么判定,这不是长短问题,而是说如果一个是另一个的开
: 头部分:s2==s1+otherValue;
: 我的做法是把短的那个duplicate: "b" => "bb",直到两个长度相等(或者前者较大也
: 可以),然后再比较;
: 同样,如果是 "ad" "adc",那么"ad"=>"adad" 再比。总之:
: s1
: s2 = s1 s1 s1 others
: then
: temp = s1 s1 s1 s1;

avatar
z*e
62
我把aba加进入,结果是这样:
原始序列:ab adb ba bab adca aa a bad baa aab aba
直接排序: a aa aab ab aba adb adca ba baa bab bad
按要求排: a aa aab aba ab adb adca baa bab ba bad
aba < ab (因为aba < abab),所以是abaab,而不是ababa,没错啊?

【在 l******e 的大作中提到】
: 你这个错了
: "ab"和"aba"怎么比的?

avatar
l*e
63
你是整个duplicate呀
还不如我那个算法。

【在 z***e 的大作中提到】
: 我把aba加进入,结果是这样:
: 原始序列:ab adb ba bab adca aa a bad baa aab aba
: 直接排序: a aa aab ab aba adb adca ba baa bab bad
: 按要求排: a aa aab aba ab adb adca baa bab ba bad
: aba < ab (因为aba < abab),所以是abaab,而不是ababa,没错啊?

avatar
b*e
64
我不是说了按 s* 排序了吗? 你们没看见?

【在 l******e 的大作中提到】
: 你是整个duplicate呀
: 还不如我那个算法。

avatar
z*e
65
你们都太抽象了,我抽象思维弱:D
你的思路跟我一样,只不过我图简单,直接把短的那个string反复concatenate,
production code的话就该直接比较substring,这些都无所谓。反正总体思路是在长的
里面找到第一个不匹配短的那个的部分,然后进行cmp. 其实这并不是字符串长短问题
,而是说短的string是长string的第一个substring.就像上面说的,其实是 s1=s*, s2
=s*, 然后比较s1和s2.

【在 l******e 的大作中提到】
: 你是整个duplicate呀
: 还不如我那个算法。

avatar
c*t
66
刚注意到,Xentar 早就把答案写在那里了。。
这题没啥好办法。最多稍微 optimize 一下。举几个极端的例子
a
aa
aaa
aaaa
aaaaa
... // all prefix = a
b
ba
baba
... // all prefix = b
所有的 prefix 的长度都是 1+ 。而且没有一个 prefix 是另外一个
prefix 的 prefix 。
很明显,我们最终的选择的 string 有在是 sort 里面最小的那个
prefix 的组里面。但是在该组里面,应该取什么是个 recursive
的问题(也就是去掉 common prefix 以后,去掉产生的 "",sort
该组以及其它所有的 string。当然,其它 prefix 的已经 sort)。
avatar
t*t
67
给你反例了你还看不懂就是你自己的问题了

【在 h***r 的大作中提到】
: 字典排序呀,有什么问题。
: 反例呢 : ) 谢谢!

avatar
l*e
68
你们全是英文,懒得看
看了thrust的贴,就回了一个

【在 b***e 的大作中提到】
: 我不是说了按 s* 排序了吗? 你们没看见?
avatar
b*e
69
如果一个帖子, 能把我, thrust, xentar, coconut几个老家伙都扯进来, 就算是成功
了. 本帖显然很成功.
我已经记不清这几个人可以回溯到什么时候了. coconut好像99/00就在了, thrust和
xentar可能是01或02的样子. 其实还有个netghost, 也是很面熟的样子, 大概也是99/
00吧. 我从开天辟地的时候就在了. Sometimes when you look at it, it's
amazing that after these many years, it is still us here.
coconut和我原来好像还混过数学版, 后来那边越来越牛了, 我不得不转战到这里了.
avatar
l*e
70
其实很多人都在
只不过换马甲了......

99/

【在 b***e 的大作中提到】
: 如果一个帖子, 能把我, thrust, xentar, coconut几个老家伙都扯进来, 就算是成功
: 了. 本帖显然很成功.
: 我已经记不清这几个人可以回溯到什么时候了. coconut好像99/00就在了, thrust和
: xentar可能是01或02的样子. 其实还有个netghost, 也是很面熟的样子, 大概也是99/
: 00吧. 我从开天辟地的时候就在了. Sometimes when you look at it, it's
: amazing that after these many years, it is still us here.
: coconut和我原来好像还混过数学版, 后来那边越来越牛了, 我不得不转战到这里了.

avatar
t*t
71
表扯我, 我算法不熟. 我是业余写程序的! 你们都是大牛.
其实我和xentar也99年就在了.

99/

【在 b***e 的大作中提到】
: 如果一个帖子, 能把我, thrust, xentar, coconut几个老家伙都扯进来, 就算是成功
: 了. 本帖显然很成功.
: 我已经记不清这几个人可以回溯到什么时候了. coconut好像99/00就在了, thrust和
: xentar可能是01或02的样子. 其实还有个netghost, 也是很面熟的样子, 大概也是99/
: 00吧. 我从开天辟地的时候就在了. Sometimes when you look at it, it's
: amazing that after these many years, it is still us here.
: coconut和我原来好像还混过数学版, 后来那边越来越牛了, 我不得不转战到这里了.

avatar
z*e
72
我说,如果你们公司要招人的话,我very愿意过来拜见的...

【在 t****t 的大作中提到】
: 表扯我, 我算法不熟. 我是业余写程序的! 你们都是大牛.
: 其实我和xentar也99年就在了.
:
: 99/

avatar
t*t
73
你干啥子的, 不是M$的人吗? 我是做硬件的, 你也会业余做硬件吗?

【在 z***e 的大作中提到】
: 我说,如果你们公司要招人的话,我very愿意过来拜见的...
avatar
z*e
74
...
完了,我是纯软工...
但是intel这些也要招软工啊...

【在 t****t 的大作中提到】
: 你干啥子的, 不是M$的人吗? 我是做硬件的, 你也会业余做硬件吗?
avatar
h*r
75
别太欺负人啦,wuwu
反例还是能看懂的。
就是每看到。在第几楼呀?

【在 t****t 的大作中提到】
: 给你反例了你还看不懂就是你自己的问题了
avatar
l*e
76
i fule u
22266

【在 h***r 的大作中提到】
: 别太欺负人啦,wuwu
: 反例还是能看懂的。
: 就是每看到。在第几楼呀?

avatar
h*r
77
thanks. That's is a good conter example : )

【在 l******e 的大作中提到】
: i fule u
: 22266

avatar
d*j
78
这道题好像是facebook hacker cup 2011的第三题吧
刚开始没仔细看掉到陷阱了,直接sort连接..-_-
看到板上举得例子 "bc" "bca" 正解是 bcabc 而不是bcbca,才恍然大悟...
再看这个例子,如果是"bc" "bcd",那么sort再连接就没问题了
(楼上其他人举的例子和这个类似啦)
明显发现:如果一个词A=wx是另外一个词B=w的前缀,那么就需要考虑长单词多余部分x
和前缀w的大小,才能决定结果是AB 还是BA。
如果没有前缀关系,顺序连接打印就行了。
这就是我的idea,sort+栈+额外处理。
1.先sort.
2.第一个单词入栈
3.检查下一个单词cur是否以栈顶单词top为前缀,
a.如果不是,栈中元素全部 pop出,打印; cur入栈
b.是, 检查cur多余的部分x和top的大小
i. x<=top小,cur入栈
ii. x>top, top出栈打印
4. 重复3步骤直到单词表尾
5. 如果栈不为空,全部pop出栈打印
其中3步骤的几种情况,有的要下移一个单词检查,有的要继续检查当前cur单词
复杂度的话,假设检查前缀的时间为constant,总共有N个单词
排序O(NlogN) + O(N)
最坏情况:后一个都是前一个单词前缀,且多余的x都小于前缀,全部入栈,最后全部出
栈,2N时间. 如果x为空,既所有的单词都一样的,x="", 也是2N时间
写出来的程序应该可以继续优化合并代码。
我试了一下貌似是对的,但不完全确定。
谁能检查一下,多谢
avatar
d*j
79
JobHunting有个更简单的答案,我想多了.......sigh
avatar
g*e
80
link pls? thx

【在 d****j 的大作中提到】
: JobHunting有个更简单的答案,我想多了.......sigh
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。