返回题库

PUMaC 2007 · 组合(B 组) · 第 3 题

PUMaC 2007 — Combinatorics (Division B) — Problem 3

专题
Contest Math / 竞赛数学
难度
L3
来源
PUMaC

题目详情

一个 80×8080 \times 80 的方格染成橙色和黑色。一个方格是黑色当且仅当它下方或左方的方格恰好有一个是黑色(如果没有这样的方格,视为橙色)。唯一的例外是左下角为黑色。考虑从左上到右下的对角线,这条对角线上有多少个黑色方格?

英文原题

  1. An 80x80 grid is colored orange and black. A square is black if and only if either the square below
    it or the square to the left of it is black, but not both (If there is no such square, consider it as if it
    were orange). The only exception is the bottom left square, which is black. Consider the diagonal
    from the upper left to the lower right. How many black squares does this diagonal have?
解析

给格子编号为 (i,j)(i,j),左下角为 (0,0)(0,0)。题中的染色规则等价于每个格子的颜色是下方和左方颜色的异或。因此 (i,j)(i,j) 的颜色为

(i+ji)(mod2).\binom{i+j}{i}\pmod 2.

在 80×8080\times80 棋盘中,从左上到右下的对角线对应

i+j=79.i+j=79.

因此问题变成求 Pascal 三角形第 7979 行中奇数项的个数。由 Lucas 定理,第 nn 行奇数项个数为

2s2(n),2^{s_2(n)},

其中 s2(n)s_2(n) 是 nn 的二进制展开中 11 的个数。

因为

79=64+8+4+2+1,79=64+8+4+2+1,

二进制中有 55 个 11,所以黑格数为

25=32.2^5=\boxed{32}.

英文解析

Index the grid squares by coordinates (i,j)(i,j), starting with the bottom-left square as (0,0)(0,0). The coloring rule says that a square is black exactly when the two relevant neighboring colors have xor equal to 11. Thus the color of (i,j)(i,j) is

(i+ji)(mod2).\binom{i+j}{i}\pmod 2.

The diagonal from upper left to lower right in an 80×8080\times80 grid consists of the squares with

i+j=79.i+j=79.

So we need the number of odd binomial coefficients in row 7979 of Pascal's triangle. By Lucas's theorem, the number of odd entries in row nn is

2s2(n),2^{s_2(n)},

where s2(n)s_2(n) is the number of 11's in the binary expansion of nn.

Since

79=64+8+4+2+179=64+8+4+2+1

has 55 ones in binary, the number of black squares is

25=32.2^5=\boxed{32}.