s*c
2 楼
求大家祝福RFE早点来,能顺利在倒退前赶上这波拿卡,经历了降级升级,实在是不
想再折腾了,谢谢,非常感谢。包子不多,先发40个。
想再折腾了,谢谢,非常感谢。包子不多,先发40个。
J*h
3 楼
在看攀登Eiger的纪录片时,听到这个说法“jump rope”. Eiger最顶上的山脊只有一
人肩膀宽,并为冰雪覆盖。一旦一个队员失足落下山脊,那么后面的队员一定要跳下另一侧
的山脊,只有这样,才能用体重平衡住失足队员,不会被拖下同一侧的悬崖。
我在想,站在那个山脊上两侧是深达几千尺的峭壁,在那一刻,不能有丝毫犹豫,纵身
跳下,这需要什么样的勇气和决断! 我们都知道在困境中,勇敢无畏者有更大的生存机会,
而句话竟能如此极端的在这里体现得淋漓尽致。
人肩膀宽,并为冰雪覆盖。一旦一个队员失足落下山脊,那么后面的队员一定要跳下另一侧
的山脊,只有这样,才能用体重平衡住失足队员,不会被拖下同一侧的悬崖。
我在想,站在那个山脊上两侧是深达几千尺的峭壁,在那一刻,不能有丝毫犹豫,纵身
跳下,这需要什么样的勇气和决断! 我们都知道在困境中,勇敢无畏者有更大的生存机会,
而句话竟能如此极端的在这里体现得淋漓尽致。
f*e
4 楼
咖啡机下面见过没
c*6
6 楼
bless
j*n
8 楼
见过,没这么黄
p*2
9 楼
这题去年讨论过。当时我太弱,没有参与。印象中是DP搞的。这次要参与了。
n*h
10 楼
Bless!!!
x*u
14 楼
pai!
A*u
17 楼
暴力解
d*y
18 楼
bless
a*o
22 楼
bLESS!
s*n
26 楼
加油,排,谢谢
j*g
27 楼
不会剪成两截。。。
p*e
28 楼
没测试过,任意数量的list
bool listcompr(ListNode * a, ListNode * b){
if(a == NULL) return true;
if(b == NULL) return false;
return a->valval;
}
int MinDiff(vector &a){
sort(a.begin(), a.end(), listcompr);
int s = 0;
while(s if(s >= a.size() - 1) return -1;
int mindiff = INT_MAX;
while(mindiff > 0){
if(a[s+1]->val - a[s]->val < mindiff)
mindiff = a[s+1]->val - a[s]->val;
a[s] = a[s]->next;
if(a[s] == NULL){
++s;
if(s == a.size() - 1)
break;
continue;
}
for(int i=s; i if(a[i]->val>a[i+1]->val)
swap(a[i], a[i+1]);
else
break;
}
return mindiff;
}
bool listcompr(ListNode * a, ListNode * b){
if(a == NULL) return true;
if(b == NULL) return false;
return a->val
}
int MinDiff(vector
sort(a.begin(), a.end(), listcompr);
int s = 0;
while(s
int mindiff = INT_MAX;
while(mindiff > 0){
if(a[s+1]->val - a[s]->val < mindiff)
mindiff = a[s+1]->val - a[s]->val;
a[s] = a[s]->next;
if(a[s] == NULL){
++s;
if(s == a.size() - 1)
break;
continue;
}
for(int i=s; i
swap(a[i], a[i+1]);
else
break;
}
return mindiff;
}
y*o
29 楼
bless
D*7
32 楼
BELSS!!!!!
b*a
34 楼
请问这题是求链表相互之间什么的最小值?
P*1
35 楼
pai, bless
p*e
37 楼
chi!
y*0
39 楼
pai, bless./
k*h
41 楼
同是天涯沦落入。
z*w
43 楼
Bless!!!
o*o
45 楼
bless
t*4
47 楼
bless
H*9
49 楼
bless
l*n
51 楼
big bless
v*6
53 楼
bless
S*s
55 楼
同时降级等待人 吃个包子祝福你
Y*X
57 楼
chi. Bless
l*i
58 楼
Imagine if you have only one list, then the pair achieving min has to be
adjacent in the sorted list.
Now you have 3 sorted list, one way to reduce it would be merge the 3 lists
and then compare adjacent elements (you need to remember from which list the
element is). Clearly this works. On a second thought you can do an implicit
merge, which is the way suggested in an earlier post, by keeping throwing
away the min in the three lists.
adjacent in the sorted list.
Now you have 3 sorted list, one way to reduce it would be merge the 3 lists
and then compare adjacent elements (you need to remember from which list the
element is). Clearly this works. On a second thought you can do an implicit
merge, which is the way suggested in an earlier post, by keeping throwing
away the min in the three lists.
j*0
59 楼
RFE on the way!
s*l
60 楼
记得原题是求min(max(|x-y|, |x-z|, |y-z|))
http://spellscroll.com/spellscrolls/question/MK1I7QsMhb4/
每次替换triplet最小的那个
Python code:
http://git.io/XFcLoQ
【在 l**h 的大作中提到】
: 看之前的面试题:
: 3 sorted linked lists, find the min(|x-y|, |x-z|, |y-z|)
B*t
61 楼
bless
h*l
64 楼
Bless!!!!!!
k*n
66 楼
bless
J*e
67 楼
zhufu
a*1
69 楼
pai bless
F*n
70 楼
RFE早点来
f*8
71 楼
pai and bless
f*8
72 楼
pai and bless
m*1
74 楼
pai and bless
m*6
75 楼
bless
b*0
76 楼
Bless!!!
y*3
77 楼
Chi
d*1
80 楼
排
f*a
81 楼
bless
f*h
82 楼
Bless
F*1
83 楼
同求!
[在 shamaneric (来来来) 的大作中提到:]
:求大家祝福RFE早点来,能顺利在倒退前赶上这波拿卡,经历了降级升级,实在是不
:想再折腾了,谢谢,非常感谢。包子不多,先发40个。
:...........
[在 shamaneric (来来来) 的大作中提到:]
:求大家祝福RFE早点来,能顺利在倒退前赶上这波拿卡,经历了降级升级,实在是不
:想再折腾了,谢谢,非常感谢。包子不多,先发40个。
:...........
n*n
84 楼
BIG BLESS!
[发表自未名空间手机版 - m.mitbbs.com]
[发表自未名空间手机版 - m.mitbbs.com]
n*r
85 楼
Bless!!!
d*e
87 楼
big bless!
d*e
88 楼
big bless!
x*2
89 楼
bless
f*b
90 楼
bless
m*z
91 楼
bless and co qiu....
j*u
92 楼
bless!
u*n
93 楼
祝福
o*0
94 楼
Bless
u*r
95 楼
chi
pai
pai
d*3
96 楼
bless
r*W
97 楼
bless!
r*W
98 楼
bless!
r*W
99 楼
bless!
j*p
100 楼
bless今天就拿到rfe
d*e
101 楼
big bless!
相关阅读