养鱼问题

来源:互联网 发布:mysql right syntax 编辑:程序博客网 时间:2024/05/16 01:33

今天看到这里讨论养鱼问题,也试试作为娱乐。据说是爱因斯坦谜题。

 

题目:

1. 有5栋5种颜色的房子
2. 每一位房子的主人国籍都不同
3. 这五个人每人只喝一个牌子的饮料,只抽一个牌子的香烟,只养一种宠物
4. 没有人有相同的宠物,抽相同牌子的烟,喝相同牌子的饮料
已知条件:
1. 英国人住在红房子里
2. 瑞典人养了一条狗
3. 丹麦人喝茶
4. 绿房子在白房子的左边
5. 绿房子主人喝咖啡
6. 抽pallmall烟的人养了一只鸟
7. 黄房子主人抽dunhill烟
8. 住在中间房子的人喝牛奶
9. 挪威人住在第一间房子
10.抽混合烟的人住在养猫人的旁边
11.养马人住在抽dunhill烟人的旁边
12.抽bluemaster烟的人喝啤酒
13.德国人抽prince烟
14.挪威人住在蓝房子旁边
15.抽混合烟的人的邻居喝矿泉水
问题:谁养鱼?

英文原题:
The Einstein Puzzle
 
There are 5 houses in five different colors. They are lined up in a row side by side.
In each house lives a person with a different nationality.
These 5 owners drink a certain drink, smoke a certain brand of tobacco and keep a certain pet.
No owners have the same pet, smoke the same tobacco, or drink the same drink.
As you look at the 5 houses from across the street, the green house is adjacent to the left of the white house
The Big Question is:
Who owns the Fish?
 
CLUES:
1、The Brit lives in the red house
2、The Swede keeps dogs as pets
3、The Dane drinks tea
4、The green house is on the immediate left of the white house as you stare at the front of the 5 houses
5、The green house owner drinks coffee
6、The person who smokes Pall Mall raises birds
7、The owner of the yellow house smokes Dunhill
8、The man living in the house right in the center drinks milk
9、The Norwegian lives in the first house
10、The man who smokes Blends lives next to the one who keeps cats
11、The man who keeps horses lives next to the one who smokes Dunhill
12、The owner who smokes Bluemaster drinks juice
13、The German smokes Prince
14、The Norwegian lives next to the blue house
15、The man who smokes Blend has a neighbor who drinks water.

 

当然不是采用穷举的办法,而是按照人的思路。

关键是忽略人的概念,把人和物放在一个层次看。很多条件都可以忽略其中提到的人,直接建立两件事物的联系。

执行结果比100多秒那么离谱要好很多:

 

德国人养鱼
Time used: 00:00:00.0468750

 

 

原创粉丝点击