【题解】CF1017C The Phone Number 鸽巢原理 dilworth定理
考虑 \(\text{Dilworth}\) 定理,若 \(LIS\) 长度为 \(L\) ,那么一定存在 \(L\) 个 \(\text{DS}\) ,那么根据鸽巢原理 \(\text{LDS}\) 的最小长度为 \(\lceil \dfrac{n}{L} \rceil\) 。
\[\text{len(LIS)} + \text{len(LDS)} \ge L + \lceil \dfrac{n}{L} \rceil \ge 2\sqrt{L\lceil \dfrac{n}{L} \rceil}
\]
\(L\) 取 \(\sqrt{n}\) 时最优。
不难想到分段构造。
(从小到大放下降子序列)