【题解】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}\) 时最优。

不难想到分段构造。

(从小到大放下降子序列)

代码记录

posted @ 2021-10-04 13:02  Themaxmaxmax  阅读(20)  评论(0编辑  收藏  举报