|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 欧拉计划 于 2016-8-11 23:19 编辑
Arithmetic expressions
By using each of the digits from the set, {1, 2, 3, 4}, exactly once, and making use of the four arithmetic operations (+, −, *, /) and brackets/parentheses, it is possible to form different positive integer targets.
For example,
8 = (4 * (1 + 3)) / 2
14 = 4 * (3 + 1 / 2)
19 = 4 * (2 + 3) − 1
36 = 3 * 4 * (2 + 1)
Note that concatenations of the digits, like 12 + 34, are not allowed.
Using the set, {1, 2, 3, 4}, it is possible to obtain thirty-one different target numbers of which 36 is the maximum, and each of the numbers 1 to 28 can be obtained before encountering the first non-expressible number.
Find the set of four distinct digits, a < b < c < d, for which the longest set of consecutive positive integers, 1 to n, can be obtained, giving your answer as a string: abcd.
题目:
通过使用集合 {1, 2, 3, 4} 中每个数字一次(用且只用一次),以及四种算术运算 (+, −, *, /) 和括号,我们可以得到不同的目标正整数。
例如:
8 = (4 * (1 + 3)) / 2
14 = 4 * (3 + 1 / 2)
19 = 4 * (2 + 3) − 1
36 = 3 * 4 * (2 + 1)
但是将相连接是不允许的,如 12 + 34。
使用集合 {1, 2, 3, 4} 可以得到 31 个目标数,其中最大的是 36。而且 1 到 28 中的每个数字都可以被表示,但是 29 不能被表示。
找出四个不同1位数的集合,a < b < c < d,能够形成最长的 1 到 n 的连续正整数集合。以 abcd 的形式给出你的答案。
|
|