avatar
请问内存条价格# Hardware - 计算机硬件
w*n
1
1. n个球,n很大 > 1billion, k个颜色, k相对小, 比如10. 要求in space sort最
efficient的做法 白板coding. (hint, k<< n 所以最后算法争取比nlog(n)小)
该题的第二问 k = 1000 实现比nlogn 更efficient的in space的算法
另外 还有elevator设计 不同楼层多个button都按下了 如何处理 多个电梯 如何处理
avatar
t*i
2
我现住 townhouse,大约 7 月初,我发现车库有点漏水,初步判断发现厕所下面管道有
点漏水,但是不确定那儿是唯一的漏水处,就打电话给物业管理,物业管理派了一个维
修工来后,大致看了以下,说 唯一的漏水是厕所下面的连接管漏水,墙内应该没有漏
水,水管工对我说,物业协会只负责墙内的损伤,不负责墙外的任何损坏,他可以帮我
修好,如果他修好我的 厕所水管,那末我需要负担所有的费用,如果他现在停止,我
不需要承担任何费用,他还说,像我这样的情况,我可以到homedepot 买一个管子自己
换掉就行了,我听从了他的建议,所以在洗衣房把水停了,第二天自己到homedepot 买
了一个管子自己换掉了,以为事情就此了了。不料大约2月前,物业协会写信来说,我
欠物业维修费$290. 我打电话过去争辩,那儿的办事人说维修工花了时间来回,他的时
间应该我付。我说,我不知道是否墙内有问题,而且是我的职责通知你们我的房子是否
有任何潜在 损伤,我不应该承担任何责任,而且我引用了维修工的话,但是接电话的
根本不听,就一直强调维修工花了时间,我应该负。现在他们发了一份律师信,要求我
付款和200律师费,不知道网上谁有处理类似事情的经验,请指教。
avatar
x*s
3
第一名:【天秤座】
烂桃花指数:★★★★★
天秤座本身的人缘是一级棒的,因此他们从来就不缺桃花,但是由于明年土星会呆在天
秤座整整一年,而土星又是带来消极的行星,明年天秤座虽然遇桃花的机会很多,但是
桃花属于烂桃花的概率会很高。更何况天秤座本身是不懂得如何抉择的星座,极有可能
会被烂桃花带衰了生活。所以2011年的天秤座,可一定要懂得分辨桃花好坏,最好是能
避则避哦。
第二名:【双鱼座】
烂桃花指数:★★★★☆
双鱼座的人2010年桃花运是十二星座之中最棒的,这都得拜带来幸运的木星所赐,在这
一年的桃花之中,即使不是正桃花,也会无伤大雅。可是在2011年,木星移位,双鱼可
就没有如此幸运了,鱼儿温柔似水,极易得到异性的喜欢,不懂得拒绝的鱼儿,如果不
形成自己的果断风格,坚定立场,当拒则拒,也是容易招来一些烂桃花的。
第三名:【狮子座】
烂桃花指数:★★★★
狮子座在明年的狮子月,刚好是带来浪漫与爱情的金星眷顾的时间,可想而知他到时候
的桃花运会有多好。不过,狮子也一向是易招来烂桃花的高危星座,他们的烂桃花常常
是来源于自己给别人的第一印象与了解之后有差距产生的。让人觉得靠谱的狮子会招来
许多人的喜欢,可是等到自己也觉得OK的时候,对方又会常常放弃了,自己空欢喜一场。
第四名:【白羊座】
烂桃花指数:★★★☆
虽然2011年一开始,木星就会在白羊座逗留,且长达近半年的时间,这也有助于提升羊
儿的桃花运。然而这并不代表羊儿的桃花都是积极向上的,相反,冲动的羊儿往往会很
容易招来一些烂桃花。羊儿经常会主动追求人,但他们往往没有考虑清楚就贸然出手,
因此常常追求着的是看不上自己的人,而追求自己的,羊儿自己又看不上。于是乎,好
感与追求只能悲剧地沦为一堆烂桃花。
第五名:【双子座】
烂桃花指数:★★★
个性独特,幽默风趣的双子座,也有很不错的人缘,他们常常可以在社交场合谈吐自如
,甚至俘获不少人的芳心。然而这也往往是他们招来一些烂桃花的原因。他们常常是说
一些不负责的话,可是别人听者却有意,因此被死缠烂打也只能怪双子自己。更何况明
年双子的总体运程还不错,栽在烂桃花上面,也算是显示老天的公平了。
avatar
d*e
4
好像从2013年起就没怎么变化了。这种状况还会持续下去多久?如果想买内存条需要等
一下吗?谢谢。
avatar
g*s
5
直接计数不行吗?O(k)的space开销,也应该算in place吧。

【在 w********n 的大作中提到】
: 1. n个球,n很大 > 1billion, k个颜色, k相对小, 比如10. 要求in space sort最
: efficient的做法 白板coding. (hint, k<< n 所以最后算法争取比nlog(n)小)
: 该题的第二问 k = 1000 实现比nlogn 更efficient的in space的算法
: 另外 还有elevator设计 不同楼层多个button都按下了 如何处理 多个电梯 如何处理

avatar
H*7
6
签过字吗?如果没有,100个律师也没用。
avatar
b*x
7
我家领导的星座又上榜了。

【在 x**********s 的大作中提到】
: 第一名:【天秤座】
: 烂桃花指数:★★★★★
: 天秤座本身的人缘是一级棒的,因此他们从来就不缺桃花,但是由于明年土星会呆在天
: 秤座整整一年,而土星又是带来消极的行星,明年天秤座虽然遇桃花的机会很多,但是
: 桃花属于烂桃花的概率会很高。更何况天秤座本身是不懂得如何抉择的星座,极有可能
: 会被烂桃花带衰了生活。所以2011年的天秤座,可一定要懂得分辨桃花好坏,最好是能
: 避则避哦。
: 第二名:【双鱼座】
: 烂桃花指数:★★★★☆
: 双鱼座的人2010年桃花运是十二星座之中最棒的,这都得拜带来幸运的木星所赐,在这

avatar
z*e
8
先搞个4GB的用着,差不了太多
avatar
g*s
9

第二个题,抽象成调度问题:
当前的电梯状态用楼层和方向描述。每个请求也用楼层和方向描述。找最优方案。
但是这里有几个问题:
1. 如何度量最优?是电梯总移动距离最短,还是平均等待时间最短?
2. 如果在执行当前方案时又有请求来了怎么办?继续执行当前方案,还是加入新请求
重新考虑?如果是
后者,公平性可能有问题。

【在 w********n 的大作中提到】
: 1. n个球,n很大 > 1billion, k个颜色, k相对小, 比如10. 要求in space sort最
: efficient的做法 白板coding. (hint, k<< n 所以最后算法争取比nlog(n)小)
: 该题的第二问 k = 1000 实现比nlogn 更efficient的in space的算法
: 另外 还有elevator设计 不同楼层多个button都按下了 如何处理 多个电梯 如何处理

avatar
t*i
10
请更详细点

【在 H******7 的大作中提到】
: 签过字吗?如果没有,100个律师也没用。
avatar
x*s
11
没事,这次不是喇叭花

【在 b*****x 的大作中提到】
: 我家领导的星座又上榜了。
avatar
w*n
12
不能计数 只能用少量的临时variable. 另外 这个题目的第二问是k如果是1000, 还是
远小于n, 实现比nlog(n)小的code

【在 g*********s 的大作中提到】
: 直接计数不行吗?O(k)的space开销,也应该算in place吧。
avatar
w*m
13
if you didn't sign anything, how can they prove you asked them to come, and
they really came? Just say, u never asked them to come.

【在 t*******i 的大作中提到】
: 请更详细点
avatar
f*e
14
我跟ld分别占据第一第二名
avatar
g*s
15
到底是一问还是两问啊?第一问是什么?第二问是什么?

【在 w********n 的大作中提到】
: 不能计数 只能用少量的临时variable. 另外 这个题目的第二问是k如果是1000, 还是
: 远小于n, 实现比nlog(n)小的code

avatar
d*2
16

and
你有跟HOA斗争的经验?

【在 w*********m 的大作中提到】
: if you didn't sign anything, how can they prove you asked them to come, and
: they really came? Just say, u never asked them to come.

avatar
b*x
17
哎,我多么希望有事啊!
我爱花花,喇叭花、桃花、牡丹、玫瑰、小荷花,我都喜欢!
可我家领导不买帐~

【在 x**********s 的大作中提到】
: 没事,这次不是喇叭花
avatar
g*s
18
ok. i see your update.
1. if k = 10, why u can't count?
2. if k = 1000, u group them into 10 group each 100 colors then apply 1.
then within group u make smaller group each 10 colors, and apply 1
again...

【在 g*********s 的大作中提到】
: 到底是一问还是两问啊?第一问是什么?第二问是什么?
avatar
t*n
19
命途多折,呜呼哀哉
avatar
w*n
20
都是k比n小很多
第一问是k=10 比logn还小
第二问是k=1000 比logn稍微大一些

【在 g*********s 的大作中提到】
: 到底是一问还是两问啊?第一问是什么?第二问是什么?
avatar
m*r
21
说的跟真的似的

【在 x**********s 的大作中提到】
: 第一名:【天秤座】
: 烂桃花指数:★★★★★
: 天秤座本身的人缘是一级棒的,因此他们从来就不缺桃花,但是由于明年土星会呆在天
: 秤座整整一年,而土星又是带来消极的行星,明年天秤座虽然遇桃花的机会很多,但是
: 桃花属于烂桃花的概率会很高。更何况天秤座本身是不懂得如何抉择的星座,极有可能
: 会被烂桃花带衰了生活。所以2011年的天秤座,可一定要懂得分辨桃花好坏,最好是能
: 避则避哦。
: 第二名:【双鱼座】
: 烂桃花指数:★★★★☆
: 双鱼座的人2010年桃花运是十二星座之中最棒的,这都得拜带来幸运的木星所赐,在这

avatar
g*s
22
or, group color by two groups and use partition in quick_sort. O(N)
repeatly do this, O(NlgK).

【在 g*********s 的大作中提到】
: ok. i see your update.
: 1. if k = 10, why u can't count?
: 2. if k = 1000, u group them into 10 group each 100 colors then apply 1.
: then within group u make smaller group each 10 colors, and apply 1
: again...

avatar
x*s
23
月亮河,我打算帮你带征婚。

【在 m*******r 的大作中提到】
: 说的跟真的似的
avatar
w*n
24

面试官阿三不让用count sort 只让用少量temp variable
复杂度?

【在 g*********s 的大作中提到】
: ok. i see your update.
: 1. if k = 10, why u can't count?
: 2. if k = 1000, u group them into 10 group each 100 colors then apply 1.
: then within group u make smaller group each 10 colors, and apply 1
: again...

avatar
y*n
25
就个人观察来说,无论哪一年貌似双鱼座都桃花旺盛
avatar
g*s
26
see 8 floor.

【在 w********n 的大作中提到】
:
: 面试官阿三不让用count sort 只让用少量temp variable
: 复杂度?

avatar
x*s
27
哇,你怎么知道月亮河是双鱼的?

【在 y********n 的大作中提到】
: 就个人观察来说,无论哪一年貌似双鱼座都桃花旺盛
avatar
w*n
28
correct
so next thing. white boarding..

【在 g*********s 的大作中提到】
: or, group color by two groups and use partition in quick_sort. O(N)
: repeatly do this, O(NlgK).

avatar
S*w
29
真的啊
太好了!

【在 x**********s 的大作中提到】
: 第一名:【天秤座】
: 烂桃花指数:★★★★★
: 天秤座本身的人缘是一级棒的,因此他们从来就不缺桃花,但是由于明年土星会呆在天
: 秤座整整一年,而土星又是带来消极的行星,明年天秤座虽然遇桃花的机会很多,但是
: 桃花属于烂桃花的概率会很高。更何况天秤座本身是不懂得如何抉择的星座,极有可能
: 会被烂桃花带衰了生活。所以2011年的天秤座,可一定要懂得分辨桃花好坏,最好是能
: 避则避哦。
: 第二名:【双鱼座】
: 烂桃花指数:★★★★☆
: 双鱼座的人2010年桃花运是十二星座之中最棒的,这都得拜带来幸运的木星所赐,在这

avatar
g*s
30
struct ball {
int color;
};
int partition(ball A[], int begin, int end, int pivot)
{
int lower = begin - 1;
for ( int k = begin; k <= end; ++ k ) {
if ( A[k].color < pivot ) {
swap(A[k], A[++lower]);
}
}
return lower
}

【在 w********n 的大作中提到】
: correct
: so next thing. white boarding..

avatar
m*r
31
别人就是随口一说,没有特指,你倒好,对号入座了。

【在 x**********s 的大作中提到】
: 哇,你怎么知道月亮河是双鱼的?
avatar
w*n
32
the little tricky function is the recursive function, where u need to
determine when to stop partition so that u can achieve Nlogk
one thing to do is to keep a variable in this partition to determine whether
this partition only contains 1 color.

【在 g*********s 的大作中提到】
: struct ball {
: int color;
: };
: int partition(ball A[], int begin, int end, int pivot)
: {
: int lower = begin - 1;
: for ( int k = begin; k <= end; ++ k ) {
: if ( A[k].color < pivot ) {
: swap(A[k], A[++lower]);
: }

avatar
x*s
33
呃。。。
而且你还上来double confirm一下。。。

【在 m*******r 的大作中提到】
: 别人就是随口一说,没有特指,你倒好,对号入座了。
avatar
g*s
34
pivot will do the job.
for example, assume u have color 0..7
u will do partition(..., 4), then partition(..., 2) on the 1st partition
and partition(..., 6) on the 2nd, etc.
so u still can do O(NlgK) w/o tracing if the color is unique in the
partition.

whether

【在 w********n 的大作中提到】
: the little tricky function is the recursive function, where u need to
: determine when to stop partition so that u can achieve Nlogk
: one thing to do is to keep a variable in this partition to determine whether
: this partition only contains 1 color.

avatar
w*n
35
i see what u mean. u r right.

【在 g*********s 的大作中提到】
: pivot will do the job.
: for example, assume u have color 0..7
: u will do partition(..., 4), then partition(..., 2) on the 1st partition
: and partition(..., 6) on the 2nd, etc.
: so u still can do O(NlgK) w/o tracing if the color is unique in the
: partition.
:
: whether

avatar
r*y
36
if k is small , could it be O(n)? for example k = 10. use int *u[10] to
save the counted balls. color 0 ball is push_front(u[0]), color 1 ball
is push_front(u[1]), .....
so what to do is just count. then this cost is O(n) ?

【在 w********n 的大作中提到】
: 1. n个球,n很大 > 1billion, k个颜色, k相对小, 比如10. 要求in space sort最
: efficient的做法 白板coding. (hint, k<< n 所以最后算法争取比nlog(n)小)
: 该题的第二问 k = 1000 实现比nlogn 更efficient的in space的算法
: 另外 还有elevator设计 不同楼层多个button都按下了 如何处理 多个电梯 如何处理

avatar
g*s
37
this is not in place if there are other attributes attached to the ball.
for example, what if each ball has a number assigned? then when u do
push_front(), the balls in that position must be moved to some tmp storage
for restore later.

【在 r*******y 的大作中提到】
: if k is small , could it be O(n)? for example k = 10. use int *u[10] to
: save the counted balls. color 0 ball is push_front(u[0]), color 1 ball
: is push_front(u[1]), .....
: so what to do is just count. then this cost is O(n) ?

avatar
r*y
38
you are right. It is a problem if we need to keep the order of the same
color
balls. But if we need not keep the order of the same color balls, then
counting works? right?
Just use the list and we have no need to use extra space.

【在 g*********s 的大作中提到】
: this is not in place if there are other attributes attached to the ball.
: for example, what if each ball has a number assigned? then when u do
: push_front(), the balls in that position must be moved to some tmp storage
: for restore later.

avatar
g*s
39

no, here i mean in-place, not stable. u don't necessarily keep the same
order. but u have to keep all information about that ball.
if the information is color only, ur approach works.

【在 r*******y 的大作中提到】
: you are right. It is a problem if we need to keep the order of the same
: color
: balls. But if we need not keep the order of the same color balls, then
: counting works? right?
: Just use the list and we have no need to use extra space.

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