Redian新闻
>
问一下这样的情况很常见吗
avatar
问一下这样的情况很常见吗# JobHunting - 待字闺中
h*n
1
找intern,发过来几道题目,其中的一道题目像这个样子:
• A father, a mother, 2 sons, 2 daughters, a guard and a prisoner
want to cross the river.
• The raft can carry only 2 people.
• The father cannot be left with any of the daughters unless the
mother is present
• The mother cannot be left with any of the sons unless the father
is present.
• The criminal cannot stay with any family member unless the guard
is present.
• Only the father, mother, and guard know how to use the raft.
还有道题是数有多少个三角形, 这样的情况很常见吗?这种是什么题?还要用程序来写?
这找intern都这么考吗?
avatar
b*5
2
挺正常的。。现在印度中国大妈都在搞这些了,你还指望不做题, 就找的到工做?
avatar
a*e
3
为啥妈不在场的话,爹就不能和女儿在场?有啥隐情?

【在 h***n 的大作中提到】
: 找intern,发过来几道题目,其中的一道题目像这个样子:
: • A father, a mother, 2 sons, 2 daughters, a guard and a prisoner
: want to cross the river.
: • The raft can carry only 2 people.
: • The father cannot be left with any of the daughters unless the
: mother is present
: • The mother cannot be left with any of the sons unless the father
: is present.
: • The criminal cannot stay with any family member unless the guard
: is present.

avatar
w*1
4
这不brain teaser吗
小学竞赛题
avatar
h*n
5
这种智力题怎么写code?对我来说这种题更多的是推理分析。因为。。。。。,所以
guard and prisoner要先乘船过去,这怎么写得到code里去?
难道要用程序笨笨地一个个试过去: 先取第一个会划船的人加一个其他的人,看看这两
人组合符不符合条件。不符合的话试下一个。回来的时候,对岸的那些人也这么一个个
试?要是方案一到最后行不通了,推倒换个方案再试? 直到找出一种方案能让所有人都
过到对岸为止
avatar
L*d
6
Formualte it as a Search problem, then solve it by using standard search
algorithm such as BFS or DFS.

father
guard

【在 h***n 的大作中提到】
: 找intern,发过来几道题目,其中的一道题目像这个样子:
: • A father, a mother, 2 sons, 2 daughters, a guard and a prisoner
: want to cross the river.
: • The raft can carry only 2 people.
: • The father cannot be left with any of the daughters unless the
: mother is present
: • The mother cannot be left with any of the sons unless the father
: is present.
: • The criminal cannot stay with any family member unless the guard
: is present.

avatar
L*d
7
这种题主要考你怎么formulate成一个search problem,然后可以用经典的BFS和DFS解
决。

【在 h***n 的大作中提到】
: 这种智力题怎么写code?对我来说这种题更多的是推理分析。因为。。。。。,所以
: guard and prisoner要先乘船过去,这怎么写得到code里去?
: 难道要用程序笨笨地一个个试过去: 先取第一个会划船的人加一个其他的人,看看这两
: 人组合符不符合条件。不符合的话试下一个。回来的时候,对岸的那些人也这么一个个
: 试?要是方案一到最后行不通了,推倒换个方案再试? 直到找出一种方案能让所有人都
: 过到对岸为止

avatar
h*n
8
谢谢!

【在 L********d 的大作中提到】
: 这种题主要考你怎么formulate成一个search problem,然后可以用经典的BFS和DFS解
: 决。

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