The beavers want to encode numbers. They developed the Quick-Beaver-Code (QB-Code).
海狸们想要对数字进行编码。于是它们开发出了“快速海狸码”(QB 码)。
This is a code consisting of squares. Every square has a certain value.
这是一个由方格组成的代码。每个方格都有一定的值。
The squares are filled line by line from the bottom to the top and from right to left.
这些方格是按照从下到上、从右到左的顺序,一行接一行地进行填满的。
The value of the ottom right square is 1. The other squares have double the value of the square before them.
右下角的方格的值为 1。其他方格的值都是其前一个方格的两倍。
Example: 例子:
Here is a 3x3 QB-Code. The beavers have encoded a number by darkening some squares.
这里有一个 3×3 的 QB 码。海狸们通过将一些方格涂黑来编码了一个数字。
The number encoded is the sum of the values of the dark squares.
编码的数字是所有深色方格数值的总和。

So the number encoded in this QB-Code is 2 + 32 + 64 = 98.
因此,此 QB 码所编码的数字为 2×32×64 = 98。
Question: 问题:
Of the following 4x4 QB-Codes, which one encodes the highest number?
在以下 4x4 的 QB 码中,哪一个编码的数字最大?

Explanation 解释
The answer is答案是
。
We will first show an example by using a 3x3 QB code
我们将首先通过一个 3×3 的二维码来展示一个示例。
We can be rearranged in a row:
我们可以排成一排:
or write it simply as 001100010. Computing the value represented by the above QB code is the same converting 001100010 from binary to decimal.
或者简单地写成 001100010。计算上述 QB 代码所表示的值,与将 001100010 从二进制转换为十进制是相同的。
Now we must think about number comparison. How do you compare 9-digit numbers written in decimal? Which one is larger, 934326958 or 936715871? You decided at the third digit, right? The first two digits are the same and the third is different, so it decides which number is larger.
现在我们必须思考数字的比较。如何比较用十进制书写的九位数?934326958 和 936715871 哪个更大?你在第三位上就做出了判断,对吧?前两位相同,第三位不同,所以它决定了哪个数更大。
Comparison in binary works the same: 010100111 is larger than 010011010. They both start with 010 and differ in the fourth digit: the second number is larger since its fourth bit is 1.
二进制数的比较方式相同:010100111 比 010011010 大。它们都以 010 开头,并且在第四个数字上有所不同:第二个数更大,因为它的第四个位是 1。
Numbers represented by A and C start with 00; B and D start with 01, so they are larger. If we compare B and D, we notice the first difference is the fourth square in the second row: D is larger.
由 A 和 C 表示的数字以 00 开头;B 和 D 以 01 开头,所以它们更大。如果我们比较 B 和 D,会发现第一个不同之处在第二行的第四个方格:D 更大。
Bebras新赛季备赛已开启,扫码领取Bebras真题资料⇓
欢迎咨询【Bebras专业辅导课程】


(Bebras每日一练部分展示)
