c***z 发帖数: 6348 | 1 1. Tell me about your research.
During the presentation, I talked about bit operations, and he let me
explained in details.
2. You are on a boat, holding an object on hand. If you throw that object to
the water, will the water level increase?
What about the level of your boat w.r. to the land?
3. You kidnapped a kid and want to use a magazine to make a ransom note (
like in the movies). Write a program to check if you have enough letters
from the magazine.
What if the size of the magazine is muc |
j*****4 发帖数: 292 | 2 2.
The water level will drop w.r.t the boat.
If the object has average density greater than water density(sink to the bot
tom), water level will drop w.r.t the bank.Otherwise,it will keep the same.
to
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
o****e 发帖数: 80 | 3 which group interviewed you?
to
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
s*******u 发帖数: 35 | 4 He is asking about boat height w/ to land. If the object sinks to the
bottom, the boat will rise w. r. t. land.
What exactly is 3 asking about? could not understand the question.
bot
same.
【在 j*****4 的大作中提到】 : 2. : The water level will drop w.r.t the boat. : If the object has average density greater than water density(sink to the bot : tom), water level will drop w.r.t the bank.Otherwise,it will keep the same. : : to
|
s****n 发帖数: 1237 | 5 bless, problem 3 looks like an open question? how do you answer this
to
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
k*******d 发帖数: 1340 | 6 最后一个,是不是可以不一个一个字母取,直接找单词 |
v******a 发帖数: 54 | 7 3.
//couting each character in the note
foreach(char a in note)
{hash_count[a]++;totalnum++}
//check characters in magazine
//reduce count in hash_count
foreach(char a in magazine)
if(hash_count[a]) {
hash_count[a]--; totalnum--;
if(totalnum==0)
return true;
}
return false;
to
skipped.
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
k*******d 发帖数: 1340 | 8 如果只有26个字母的话(或者大小写合起来,52),是不是用个数组就可以了,可能还
更快
如果是单词的话,用Hash Table倒是很方便。
【在 v******a 的大作中提到】 : 3. : //couting each character in the note : foreach(char a in note) : {hash_count[a]++;totalnum++} : //check characters in magazine : //reduce count in hash_count : foreach(char a in magazine) : if(hash_count[a]) { : hash_count[a]--; totalnum--; : if(totalnum==0)
|
|
n****e 发帖数: 629 | 9 水面下降船自然上升 不然少掉的水到哪里去了
【在 s*******u 的大作中提到】 : He is asking about boat height w/ to land. If the object sinks to the : bottom, the boat will rise w. r. t. land. : What exactly is 3 asking about? could not understand the question. : : bot : same.
|
l******f 发帖数: 568 | 10 谢chao兄分享, 88伪币奉上。
to
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
|
|
s********t 发帖数: 31 | 11 Conclusion is correct but the logic is not correct.
If the object sinks, boat will rise NOT because of water level drops.
Reason: If object floats, boat still rises even though water level will be the same.
A extreme case: the object has very large density thus no volume. So throwing
it to water is as if the boat has smaller density. So boat will rise and water level drops, both wrt to land.
【在 n****e 的大作中提到】 : 水面下降船自然上升 不然少掉的水到哪里去了
|
c***z 发帖数: 6348 | 12 第3题我开始说hash,人家问为什么不用array。
array是正确答案。简单。 |
c***z 发帖数: 6348 | 13 谢谢!
等我万一,我说万一,能进入第二轮面试,就来发包子。
【在 l******f 的大作中提到】 : 谢chao兄分享, 88伪币奉上。 : : to
|
n****e 发帖数: 629 | 14 先假设船相对地不动,水面下降/不变,丢出去的东西还排开一部分水,那么多出来的
水只能是把船托起来了
be the same.
throwing
water level drops, both wrt to land.
【在 s********t 的大作中提到】 : Conclusion is correct but the logic is not correct. : : If the object sinks, boat will rise NOT because of water level drops. : Reason: If object floats, boat still rises even though water level will be the same. : A extreme case: the object has very large density thus no volume. So throwing : it to water is as if the boat has smaller density. So boat will rise and water level drops, both wrt to land.
|
l****o 发帖数: 2909 | 15 应该拿丢出去的东西的体积和能排开的水作比较才能得出结论。
【在 n****e 的大作中提到】 : 先假设船相对地不动,水面下降/不变,丢出去的东西还排开一部分水,那么多出来的 : 水只能是把船托起来了 : : be the same. : throwing : water level drops, both wrt to land.
|
o**o 发帖数: 3964 | 16 重力和水压平衡了,从船里把东西拿走跟把船往上吊是一回事,所以船升高了,就这么
简单。
拿出来的东西扔水里算是锦上添花,再高一点。
【在 l****o 的大作中提到】 : 应该拿丢出去的东西的体积和能排开的水作比较才能得出结论。
|
c***z 发帖数: 6348 | 17 非常惊讶的知道过了第一轮...
于是兑现许诺的包子.包子很少,发完为止.
谢谢大侠们的帮助! |
l****o 发帖数: 2909 | |
r*******y 发帖数: 290 | 19 haha, re 楼主
别被laonuo吓住了
【在 l****o 的大作中提到】 : 顶ls。继续加油。还有11轮等着呢。
|
s****n 发帖数: 1237 | |
|
|
H********k 发帖数: 3950 | 21 congrats!
吃包子
【在 c***z 的大作中提到】 : 非常惊讶的知道过了第一轮... : 于是兑现许诺的包子.包子很少,发完为止. : 谢谢大侠们的帮助!
|
c***z 发帖数: 6348 | 22 啧,刚刚才知道,原来不是过了第一轮,而是把我refer到另一组了。于是又要从头开
始。 |
l******f 发帖数: 568 | 23 那也不错, 加油
【在 c***z 的大作中提到】 : 啧,刚刚才知道,原来不是过了第一轮,而是把我refer到另一组了。于是又要从头开 : 始。
|
s****n 发帖数: 1237 | 24 说明你不错,像我投了MRMA超过一个月,到现在一点消息都没有 :(
【在 c***z 的大作中提到】 : 啧,刚刚才知道,原来不是过了第一轮,而是把我refer到另一组了。于是又要从头开 : 始。
|
t*******y 发帖数: 637 | 25 你们都是网上投的还是猎头联系的啊?
【在 s****n 的大作中提到】 : 说明你不错,像我投了MRMA超过一个月,到现在一点消息都没有 :(
|
s****n 发帖数: 1237 | 26 我是猎头投的。
【在 t*******y 的大作中提到】 : 你们都是网上投的还是猎头联系的啊?
|
m*****n 发帖数: 2152 | 27 2,不难。
3,只想到个蠢办法。把note用26字母(考虑大小写的话52个)和10个数字和几个标点符
号(,.就差
不多了吧)的个数做个array。然后同样读入magazine的字符,统计个数,最后比较一
下就可以
了。如果magazine太大,就设几个check point,看看字符是不是已经足够了,如果足
够,就不
需要全读完了。
object to
note (
letters
you
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
t*****j 发帖数: 1105 | 28 water layer不变,船的位置升高了。
object to
(
you
【在 c***z 的大作中提到】 : 1. Tell me about your research. : During the presentation, I talked about bit operations, and he let me : explained in details. : 2. You are on a boat, holding an object on hand. If you throw that object to : the water, will the water level increase? : What about the level of your boat w.r. to the land? : 3. You kidnapped a kid and want to use a magazine to make a ransom note ( : like in the movies). Write a program to check if you have enough letters : from the magazine. : What if the size of the magazine is muc
|
t*****j 发帖数: 1105 | 29 我记得chaoz好像是美妈,不是兄。
【在 l******f 的大作中提到】 : 谢chao兄分享, 88伪币奉上。 : : to
|
t*****j 发帖数: 1105 | 30 应该没有比这更简单的方法了吧,最多check point的数量再优化一下。
【在 m*****n 的大作中提到】 : 2,不难。 : 3,只想到个蠢办法。把note用26字母(考虑大小写的话52个)和10个数字和几个标点符 : 号(,.就差 : 不多了吧)的个数做个array。然后同样读入magazine的字符,统计个数,最后比较一 : 下就可以 : 了。如果magazine太大,就设几个check point,看看字符是不是已经足够了,如果足 : 够,就不 : 需要全读完了。 : : object to
|
|
|
x*****t 发帖数: 8 | |