由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个puzzle
相关主题
有没有大牛看看这题目咋办问个题目,好像以前有人问过~~~
InterviewStreet problem - Meeting PointAmazon interview question.(4)
这道题DP怎么做阿怎样求common divisor 最快
dp problem on mit问个题目
问个Array Puzzle题问个onsite交通的问题
问个面试题facebook 一面
问个amazon面试题facebook的buffet puzzle
问个facebo0k的puzzle求facebook puzzle的测试文件
相关话题的讨论汇总
话题: bird话题: distance话题: tr话题: trains话题: collide
进入JobHunting版参与讨论
1 (共1页)
P*******b
发帖数: 1001
1
puzzle - 2 trains traveling in opposite direction, bird starts from one and
reaches other and flies back and forth like this till train collide. Find th
e time taken to collide, total distance traveled by the bird, and no. of tim
es bird makes a U turn.
s*****t
发帖数: 737
2
V_tr = the speed of trains
V_b = the speed of bird
S = the initial distance between two trains.
The time to collide t = S/(2*V_tr)
The total distance of bird = V_b*t
The distance between the two trains when the bird makes the first U turn is:
S1=S-2*S*V_tr/(V_tr+V_b)=S*(V_b-V_tr)/(V_tr+V_b)
let r=(V_b-V_tr)/(V_tr+V_b)
The distance between the two trains when the bird makes the second U trun is:
S2=S1*r=S*r^2
So the number of times bird makes a U turn is m, where
S*r^m < size(a bird)
This should

【在 P*******b 的大作中提到】
: puzzle - 2 trains traveling in opposite direction, bird starts from one and
: reaches other and flies back and forth like this till train collide. Find th
: e time taken to collide, total distance traveled by the bird, and no. of tim
: es bird makes a U turn.

h**k
发帖数: 3368
3
the number of bird making u-turn should be infinite.
The distance bird flying each time is a sequence becoming closer to 0 and
can not reach 0 if time and distance can be divided infinitely.

is:
is:

【在 s*****t 的大作中提到】
: V_tr = the speed of trains
: V_b = the speed of bird
: S = the initial distance between two trains.
: The time to collide t = S/(2*V_tr)
: The total distance of bird = V_b*t
: The distance between the two trains when the bird makes the first U turn is:
: S1=S-2*S*V_tr/(V_tr+V_b)=S*(V_b-V_tr)/(V_tr+V_b)
: let r=(V_b-V_tr)/(V_tr+V_b)
: The distance between the two trains when the bird makes the second U trun is:
: S2=S1*r=S*r^2

s*********t
发帖数: 1663
4
isn't this a typical mistake of limit?

【在 h**k 的大作中提到】
: the number of bird making u-turn should be infinite.
: The distance bird flying each time is a sequence becoming closer to 0 and
: can not reach 0 if time and distance can be divided infinitely.
:
: is:
: is:

s*****t
发帖数: 737
5
You should not ignored the size of the bird, which means the distance can
not be divided infinitely.

【在 h**k 的大作中提到】
: the number of bird making u-turn should be infinite.
: The distance bird flying each time is a sequence becoming closer to 0 and
: can not reach 0 if time and distance can be divided infinitely.
:
: is:
: is:

1 (共1页)
进入JobHunting版参与讨论
相关主题
求facebook puzzle的测试文件问个Array Puzzle题
facebook HR电面让作puzzle,有谁有类似经验吗?问个面试题
facebook面试大概是个什么流程?问个amazon面试题
报一个facebook的offer,晚点补上面经问个facebo0k的puzzle
有没有大牛看看这题目咋办问个题目,好像以前有人问过~~~
InterviewStreet problem - Meeting PointAmazon interview question.(4)
这道题DP怎么做阿怎样求common divisor 最快
dp problem on mit问个题目
相关话题的讨论汇总
话题: bird话题: distance话题: tr话题: trains话题: collide