ASC 36 Editorial

Правка en7, от ezraft, 2026-01-13 21:38:19

Contest link: https://mirror.codeforces.com/gym/100430    

100430A - Chip Installation

100430B - Divisible Substrings

100430C - Preparing Documents

100430D - GridBagLayout

100430E - Hot Potato Routing

100430F - Knapsack Problem

For a subset $$$A \subset {1, \ldots, n}$$$ we introduce the notation

$$$s(A) = \sum_{a \in A} w_a$$$

for convenience. First, note that $$$\mathcal{I}$$$ always contains $$$\varnothing,$$$ since $$$s(\varnothing) = 0$$$. As a result we cannot violate condition $$$1.$$$ Similarly, it is impossible to violate condition $$$2,$$$ since for $$$A \supset B$$$ we have

$$$s(A) = s(B) + s(A \setminus B),$$$

and $$$s(A \setminus B) \geq 0$$$ by non-negativity of the weights $$$w_i.$$$

We say a set $$$A$$$ is constrained if $$$s(A) \leq c$$$ and for all $$$x \not \in A,$$$ $$$s(A \cup {x}) \geq c.$$$ Clearly if we can find constrained sets $$$A, B$$$ with $$$|A| \neq |B|$$$ then we have a contradiction to the third condition.

Consider the sets $$$M_{\min}$$$ and $$$M_{\max}$$$ constructed as follows:

For $$$M_{\min},$$$ iterate through the indices $$${1,\ldots, n}$$$ in non-decreasing order of $$$w_i.$$$ At each index, if adding it to the set keeps $$$s(M_{\min})$$$ at most $$$c,$$$ then add it to $$$M_{\min}.$$$ For $$$M_{\max},$$$ perform the same algorithm with the indices initially in non-increasing order of weights.

It is well known that $$$M_{\min}$$$ is the constrained set with the maximum size and $$$M_{\max}$$$ is the constrained set of minimum size. I leave it as an exercise to prove this.

If $$$|M_{\min}| \gt |M_{\max}|$$$ then we are done. Otherwise, we know that all constrained sets have the same size; call this $$$k.$$$

We now make the following claim: If $$$|A| \gt |B|$$$ are sets which contradict property $$$3$$$, then there exist sets $$$C \supset A$$$ and $$$D \supset B$$$ such that $$$|C| = k$$$ and $$$|D| = k - 1$$$ which also contradict this property. We split the proof of this claim into two lemmas.

Lemma 1. If $$$|A| \lt k$$$ then we can construct $$$|C| = k.$$$

Proof: Since $$$|B| \lt |A| \lt k$$$ neither of these sets are constrained. Then there exist indices $$$i,j$$$ which can be added to $$$B$$$ and $$$A$$$ respectively. We can add $$$x = \argmin_{u \in {i,j}} w_u$$$ to both sets. The proof is completed by induction.

Lemma 2. If $$$|A| - |B| \gt 1$$$ then we can construct $$$|C| - |D| = 1.$$$

Proof:

100430G - Magic Potions

100430H - Restoring Permutation

100430I - Roads

100430J - Squary Set

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en36 Английский diss_quack 2026-01-29 02:09:27 0 (published)
en35 Английский 0mar 2026-01-29 01:37:05 6 type for J
en34 Английский diss_quack 2026-01-29 01:30:47 6
en33 Английский diss_quack 2026-01-29 01:26:25 41
en32 Английский 0mar 2026-01-28 23:16:26 36
en31 Английский 0mar 2026-01-28 23:12:51 964
en30 Английский diss_quack 2026-01-28 20:26:06 885
en29 Английский ezraft 2026-01-28 19:50:26 146
en28 Английский ezraft 2026-01-28 19:22:57 747
en27 Английский ezraft 2026-01-28 19:05:23 25
en26 Английский ezraft 2026-01-28 19:04:37 5
en25 Английский ezraft 2026-01-28 19:04:00 3351
en24 Английский ezraft 2026-01-28 18:55:02 90
en23 Английский diss_quack 2026-01-14 22:11:54 772
en22 Английский diss_quack 2026-01-14 20:55:29 29
en21 Английский diss_quack 2026-01-14 20:54:21 275
en20 Английский diss_quack 2026-01-14 20:51:21 225
en19 Английский diss_quack 2026-01-14 20:46:23 1179
en18 Английский 0mar 2026-01-14 08:31:30 6
en17 Английский 0mar 2026-01-14 08:30:46 13
en16 Английский 0mar 2026-01-14 08:29:49 1584 add H editorial
en15 Английский diss_quack 2026-01-14 00:00:09 3020
en14 Английский diss_quack 2026-01-13 23:08:11 16
en13 Английский diss_quack 2026-01-13 23:04:07 3121
en12 Английский ezraft 2026-01-13 22:43:35 22
en11 Английский ezraft 2026-01-13 22:36:51 97 Tiny change: 'A \subset \{1, \ldots, n\}$ we intr' -> 'A \subset {1, \ldots, n}$ we intr'
en10 Английский ezraft 2026-01-13 22:26:58 1267
en9 Английский ezraft 2026-01-13 21:41:35 248
en8 Английский ezraft 2026-01-13 21:39:13 6 Tiny change: 'add $x = \argmin_{u \in \{' -> 'add $x = \text{argmin}_{u \in \{'
en7 Английский ezraft 2026-01-13 21:38:19 667
en6 Английский ezraft 2026-01-13 21:30:26 4 Tiny change: 'et $A$ is `constrained` if $s(A) ' -> 'et $A$ is _constrained_ if $s(A) '
en5 Английский ezraft 2026-01-13 21:30:00 8
en4 Английский ezraft 2026-01-13 21:28:53 64
en3 Английский ezraft 2026-01-13 21:28:13 1414
en2 Английский ezraft 2026-01-13 21:13:02 44
en1 Английский ezraft 2026-01-13 21:12:14 416 Initial revision (saved to drafts)