由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个智力题
相关主题
也来贡献一个Bloomberg的店面[合集] Re: 贡献两个智力题,攒RP ( QUALCOMM)
新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?[合集] 贡献两个智力题,攒RP ( QUALCOMM)
发点面试题讨包子(cs)一个分享收藏各种面试题智力题的中文网站(spellscroll.com)
M家电面brain teaser没答对,会跪么?这样的电话可以打吗?
问一道统计题bloomberg也败掉了
一道概率题总结一下这个版上的热门公司,招的都是什么样的人!
请教一个概率问题bloomberg online assessment
再奉献一道GOOGLE的智力题bloomberg online test 的智力题
相关话题的讨论汇总
话题: solution话题: difference话题: 变成话题: long话题: yellow
进入JobHunting版参与讨论
1 (共1页)
B******l
发帖数: 262
1
有三种颜色的球,红色13个,绿色16个,黄色 17个,有一个方法可以使球变色,拿出
两个不同颜色的球,就能变成第三种颜色,如拿出一个红色,一个黄色,就会变成两个
绿色的球。问有没有可能把这些球变成同一种颜色,如果可能,怎么做,如果不可能,
为什么。引申,x个红球,y个绿球,z个黄球,当x,y,z满足什么关系时,一定有解决
方案,否则无解。
x***y
发帖数: 633
2
1 green + 1 yellow => 15 red + 15 green+ 16 yellow
15*(1 red + 1 green) => 46 yellow
As long as the difference between any 2 groups is a multiple of 3 and the
total amount is >= 4/3 * the difference.

【在 B******l 的大作中提到】
: 有三种颜色的球,红色13个,绿色16个,黄色 17个,有一个方法可以使球变色,拿出
: 两个不同颜色的球,就能变成第三种颜色,如拿出一个红色,一个黄色,就会变成两个
: 绿色的球。问有没有可能把这些球变成同一种颜色,如果可能,怎么做,如果不可能,
: 为什么。引申,x个红球,y个绿球,z个黄球,当x,y,z满足什么关系时,一定有解决
: 方案,否则无解。

b***e
发帖数: 1419
3
如果三数模3的余数各不相同, 就是分别是0, 1, 2, 则无解,因为(0,1,2)在题目所给
出的变换下总是回到(0,1,2)。否则有解, easy to see.
a**********k
发帖数: 1953
4
This one has a solution:
(0, 1, 2 ) -> (0+1, 1-1, 2-1)->(1,0,1)->(1-1,0+1,1-1)->(0,1,0)
I think it works as long as the difference between any two groups is even.

【在 b***e 的大作中提到】
: 如果三数模3的余数各不相同, 就是分别是0, 1, 2, 则无解,因为(0,1,2)在题目所给
: 出的变换下总是回到(0,1,2)。否则有解, easy to see.

l*********r
发帖数: 674
5
你第一步错了:(0,1,2) -〉(2,0,1)而不是(1,0,1)。两个变成两个,而不是merge
成一个。球的总数不能变的。

【在 a**********k 的大作中提到】
: This one has a solution:
: (0, 1, 2 ) -> (0+1, 1-1, 2-1)->(1,0,1)->(1-1,0+1,1-1)->(0,1,0)
: I think it works as long as the difference between any two groups is even.

b***e
发帖数: 1419
6
This is a different problem. But if you go this way, there's always a
solution, because if there are two ball with different colors, you can
merge them to reduce the total number of balls. So the end of the day,
you will certainly have all balls in the same color where the bottomline
is you have only 1 ball.

even.

【在 a**********k 的大作中提到】
: This one has a solution:
: (0, 1, 2 ) -> (0+1, 1-1, 2-1)->(1,0,1)->(1-1,0+1,1-1)->(0,1,0)
: I think it works as long as the difference between any two groups is even.

z***i
发帖数: 9880
7
1.绿球+黄球=2红球,三种球数量变成15,15,16.
然后一路红球和绿球变下去就行了。

【在 B******l 的大作中提到】
: 有三种颜色的球,红色13个,绿色16个,黄色 17个,有一个方法可以使球变色,拿出
: 两个不同颜色的球,就能变成第三种颜色,如拿出一个红色,一个黄色,就会变成两个
: 绿色的球。问有没有可能把这些球变成同一种颜色,如果可能,怎么做,如果不可能,
: 为什么。引申,x个红球,y个绿球,z个黄球,当x,y,z满足什么关系时,一定有解决
: 方案,否则无解。

k*******a
发帖数: 772
8
每次变化,三个数之间3对差的对3的余数保持不变,所以要变成0 0 x的话,必须有两
个数,差能被3整除,而这两个数最后变成0
m*****k
发帖数: 731
9
how about 5 2 0?
5+2 = 7>= (5-2)*4/3
I think so long as G1 - G2 = 3k and G3>=k then we have a solution.

【在 x***y 的大作中提到】
: 1 green + 1 yellow => 15 red + 15 green+ 16 yellow
: 15*(1 red + 1 green) => 46 yellow
: As long as the difference between any 2 groups is a multiple of 3 and the
: total amount is >= 4/3 * the difference.

j**w
发帖数: 382
10
13,16,17
0,29,4
2,27,2
0,29,0
1 (共1页)
进入JobHunting版参与讨论
相关主题
bloomberg online test 的智力题问一道统计题
大家平时智力题都怎么练啊?一道概率题
GOOGLE电面的问题请教一个概率问题
请教一个bloomberg题目再奉献一道GOOGLE的智力题
也来贡献一个Bloomberg的店面[合集] Re: 贡献两个智力题,攒RP ( QUALCOMM)
新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?[合集] 贡献两个智力题,攒RP ( QUALCOMM)
发点面试题讨包子(cs)一个分享收藏各种面试题智力题的中文网站(spellscroll.com)
M家电面brain teaser没答对,会跪么?这样的电话可以打吗?
相关话题的讨论汇总
话题: solution话题: difference话题: 变成话题: long话题: yellow