返回题库

PUMaC 2007 · 个人决赛(A 组) · 第 2 题

PUMaC 2007 — Individual Finals (Division A) — Problem 2

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

题目详情

  1. 有一个2007×20072007 \times 2007的方格表,其中填入了非负整数。对于表中每个为 0 的格子,与其在同一行或同一列的元素之和至少为 2007。求此类方格表中所有元素之和的最小值。

英文原题

  1. We have a 2007 × 2007 square table filled with nonnegative integers. For each entry of 0 in the
    table, the sum of the elements that are in the same row or column as that entry is at least 2007.
    Find the minimum sum of all the elements of such a table.
解析

2007×20072007 \times 2007 表格,每个 0 所在行列之和(不含自身)至少 2007。求最小总和。

设第一行(除 (1,1)(1,1) 外)全为 xx,第一列(除 (1,1)(1,1) 外)全为 yy,(1,1)=0(1,1)=0,其余全 0。共有 (2006)2+1(2006)^2+1 个零。

对 i,j≥2i,j \ge 2 的零:Ri=yR_i = y, Cj=xC_j = x,需 x+y≥2007x+y \ge 2007。总和 S=2006(x+y)≥2006⋅2007S = 2006(x+y) \ge 2006 \cdot 2007。

取 x=1004,y=1003x=1004, y=1003 达到下界。

最小总和:4026042\boxed{4026042}。


英文解析

2007×20072007 \times 2007 table with nonnegative integers. For each 0 entry, the sum of its row and column (excluding the 0 itself, but including all other entries in that row and column) is at least 2007. Find minimum total sum.

Let the table entries be aij≥0a_{ij} \ge 0. Total sum S=∑i,jaijS = \sum_{i,j} a_{ij}.

For each zero entry at (i,j)(i,j), let Ri=∑kaikR_i = \sum_k a_{ik} (row sum) and Cj=∑kakjC_j = \sum_k a_{kj} (col sum). The condition is Ri+Cj−2aij≥2007R_i + C_j - 2a_{ij} \ge 2007. Since aij=0a_{ij}=0, this is Ri+Cj≥2007R_i + C_j \ge 2007.

Key observation: If there are many zeros, each zero (i,j)(i,j) forces Ri+Cj≥2007R_i + C_j \ge 2007. We want to minimize S=∑iRiS = \sum_i R_i.

Lower bound construction: Place 2007 in the first row and first column (except the (1,1)(1,1) entry which can be 0). Specifically:

  • a11=0a_{11} = 0
  • a1j=1a_{1j} = 1 for j=2,…,2007j=2,\ldots,2007
  • ai1=1a_{i1} = 1 for i=2,…,2007i=2,\ldots,2007
  • All other aij=0a_{ij} = 0 for i,j≥2i,j \ge 2

There are (2006)2(2006)^2 zeros at positions (i,j)(i,j) with i,j≥2i,j \ge 2. For each such zero: Ri=ai1=1R_i = a_{i1} = 1, Cj=a1j=1C_j = a_{1j} = 1, so Ri+Cj=2<2007R_i + C_j = 2 < 2007. This FAILS the condition!

Revised construction: Make the first row and column have large enough values. Let a1j=1004a_{1j} = 1004 for j≥2j \ge 2, ai1=1003a_{i1} = 1003 for i≥2i \ge 2, and a11=0a_{11}=0. For i,j≥2i,j \ge 2: aij=0a_{ij}=0.
Row sums: R1=2006⋅1004=2014024R_1 = 2006 \cdot 1004 = 2014024, Ri=1003R_i = 1003 for i≥2i \ge 2.
Col sums: C1=2006⋅1003=2014018C_1 = 2006 \cdot 1003 = 2014018, Cj=1004C_j = 1004 for j≥2j \ge 2.
For zero at (i,j)(i,j) (i,j≥2i,j \ge 2): Ri+Cj=1003+1004=2007R_i + C_j = 1003 + 1004 = 2007. ✓
For zero at (1,1)(1,1): R1+C1R_1 + C_1 is huge, easily ≥ 2007. ✓

Total sum S=0+2006⋅1004+2006⋅1003=2006⋅2007=4026042S = 0 + 2006 \cdot 1004 + 2006 \cdot 1003 = 2006 \cdot 2007 = 4026042.

Optimality: For each zero (i,j)(i,j), Ri+Cj≥2007R_i + C_j \ge 2007. Summing over all kk zeros: ∑(i,j):aij=0(Ri+Cj)≥2007k\sum_{(i,j): a_{ij}=0} (R_i + C_j) \ge 2007k. Each row sum RiR_i is counted once for each zero in that row. If row ii has ziz_i zeros: ∑iziRi+∑jzj′Cj≥2007k\sum_i z_i R_i + \sum_j z'_j C_j \ge 2007k, where zj′z'_j is zeros in column jj.

The minimum is achieved by the construction above, giving Smin⁡=2006⋅2007=4026042S_{\min} = 2006 \cdot 2007 = \boxed{4026042}.

Wait — can we do better? The constraint is only on zeros. If we avoid zeros more cleverly, we might reduce the sum. The extreme case: put 0 at only one position, say (1,1)(1,1). Then R1+C1≥2007R_1 + C_1 \ge 2007. The minimum sum for this single-zero case: minimize R1+C1+∑i≥2Ri+∑j≥2Cj−overlapR_1 + C_1 + \sum_{i \ge 2} R_i + \sum_{j \ge 2} C_j - \text{overlap} subject to R1+C1≥2007R_1 + C_1 \ge 2007. This is achieved by R1=2007,C1=0R_1 = 2007, C_1 = 0 with all other entries 0, giving S=2007S = 2007. But then the (1,1)(1,1) entry itself: if it's 0, then its row sum R1R_1 includes a12,…,a1,2007a_{12},\ldots,a_{1,2007}, and col sum C1C_1 includes a21,…,a2007,1a_{21},\ldots,a_{2007,1}. If everything else is 0, R1=2007R_1 = 2007 means a11+0+⋯=2007a_{11} + 0 + \cdots = 2007 but a11=0a_{11}=0, so impossible. The row/col sum condition at the zero IS the sum of the OTHER entries. So we need R1+C1≥2007R_1 + C_1 \ge 2007, and R1R_1 includes everything in row 1, C1C_1 includes everything in col 1.

OK, the simplest possible: put only ONE zero at (1,1)(1,1). Put nothing else in row 1 or col 1 except what's needed to satisfy the constraint. Let R1=∑ja1jR_1 = \sum_j a_{1j}, C1=∑iai1C_1 = \sum_i a_{i1}. Need R1+C1−2a11≥2007R_1 + C_1 - 2a_{11} \ge 2007. With a11=0a_{11} = 0, need R1+C1≥2007R_1 + C_1 \ge 2007. Minimize total sum S=R1+C1+everything else−a11S = R_1 + C_1 + \text{everything else} - a_{11}. Since we can make all other entries 0 and just adjust a12a_{12} and a21a_{21}: set a12=2007a_{12} = 2007, all others 0. Then R1=2007R_1 = 2007, C1=0C_1 = 0. R1+C1=2007≥2007R_1 + C_1 = 2007 \ge 2007 ✓. Total S=2007S = 2007.

But wait: is (1,1)(1,1) the only zero? Yes: all other entries are non-zero (they're 0 but 0 is allowed to be "non-zero"? No, the condition is only about entries that ARE zero. If we set aij=0a_{ij} = 0 for i,j≥2i,j \ge 2, then those are ALSO zeros, and the condition applies to them too! Every zero in the table needs its row+col sum ≥ 2007.

So if we set all aij=0a_{ij}=0 for i,j≥2i,j \ge 2 (to minimize sum), then all (2006)2(2006)^2 of those entries are zeros, and each needs its row sum + col sum ≥ 2007. This forces total sum to be large.

The optimal construction balances the number of zeros with the required row/col sums. The construction with first row entries = xx, first col entries = yy, a11=0a_{11}=0, all others 0:

  • (2006)2+1(2006)^2 + 1 zeros (all except first row/col non-diagonal entries)
  • For i≥2,j≥2i \ge 2, j \ge 2: Ri=yR_i = y, Cj=xC_j = x, need x+y≥2007x+y \ge 2007.
  • R1=2006xR_1 = 2006x, C1=2006yC_1 = 2006y, need 2006(x+y)≥20072006(x+y) \ge 2007 (for (1,1)(1,1) zero), automatically satisfied.
  • S=2006x+2006y=2006(x+y)≥2006⋅2007=4026042S = 2006x + 2006y = 2006(x+y) \ge 2006 \cdot 2007 = 4026042.

Can we do better by making some entries non-zero? If we set aij=1a_{ij} = 1 for some i,j≥2i,j \ge 2, those entries become non-zero (no zero condition applies), but the sum goes up by 1. The benefit: one fewer zero to satisfy. The cost: +1. The zero condition requires Ri+Cj≥2007R_i + C_j \ge 2007, which typically costs much more than 1. So making entries non-zero (to reduce zeros) only helps if it enables much smaller row/col sums. But making a single entry non-zero barely changes row/col sums.

The lower bound S≥2006⋅2007S \ge 2006 \cdot 2007 is tight with the construction above. So minimum is 4026042\boxed{4026042}.