828. Numbers Challenge

It is a common recreational problem to make a target number using a selection of other numbers. In this problem you will be given six numbers and a target number.

For example, given the six numbers , , , , , , and a target of , one possible solution is:

This uses all six numbers. However, it is not necessary to do so. Another solution that does not use the is:

Define the score of a solution to be the sum of the numbers used. In the above example problem, the two given solutions have scores and respectively. It turns out that this problem has no solutions with score less than .

When combining numbers, the following rules must be observed:

The attached file number-challenges.txt contains 200 problems, one per line in the format:

211:2,3,4,6,7,25

where the number before the colon is the target and the remaining comma-separated numbers are those available to be used.

Numbering the problems 1, 2, ..., 200, we let be the minimum score of the solution to the th problem. For example, , as the first problem in the file is the example given above. Note that not all problems have a solution; in such cases we take .

Find . Give your answer modulo .

828. 数字挑战

通过某些数字,对其进行运算,来得到目标数字,是数学圈常见的一种消遣。本题中,你需要用六个数字通过运算得到目标数字。

例如,给定六个数字 ,目标数字为 时,一种可能的解法如下:

这个解法用上的所有的六个数。但这其实没有必要,下面的这个解法就没有使用

定义一个解法的分数为所有使用的数字之和。以上两个解法的分数分别为 。可以发现,在本题中,没有解法的分数会低于

在用运算组合数字的时候,必须遵守以下规则:

下发文件 number-challenges.txt 包括 200 道题目,每道题的格式如下:

211:2,3,4,6,7,25

冒号前的数字是目标数字,而后面六个用逗号隔开的数字就是给定的数字了。

将所有题目编号为 。记 为第 题所有解法的最小得分。如上所述,。注意,不是所有题目都有解。若有题目无解,则置

之值。


这个链接 回到源站。

这个链接 回到详细版题目目录。