随笔分类 -  DP-线性dp

摘要:题目链接 题目 Peter decided to wish happy birthday to his friend from Australia and send him a card. To make his present more mysterious, he decided to make 阅读全文
posted @ 2021-12-24 19:02 zhangtingxi 阅读(116) 评论(0) 推荐(0)
摘要:题目链接 题目 Your company has just constructed a new skyscraper, but you just noticed a terrible problem: there is only space to put one game room on each 阅读全文
posted @ 2021-12-08 18:13 zhangtingxi 阅读(405) 评论(0) 推荐(0)
摘要:题目链接 首先第一问很好求,就是求最长下降子序列,\(n\leqslant 5000\),\(O(n^2)\) 暴力转移就行。 而这道题的难点就在于去重。 对于 \(i\) 和 \(j\)(\(i>j\)),如果 \(a_i=a_j\) 且 \(dp_i=dp_j\),说明他们是相同的,\(i\) 阅读全文
posted @ 2021-11-21 19:06 zhangtingxi 阅读(46) 评论(0) 推荐(0)
摘要:题目大意 我们称一个集合 \(S={(x_1, y_1), (x_2, y_2), … , (x_k, y_k)}\) 是好的,当且仅当把它们按照 \(y_i\) 降序排序后满足: 对于所有满足 \(3 ≤ j ≤ k\) 的 \(j\),有 \(x_j−2 < x_j < x_j−1\) 或者 \ 阅读全文
posted @ 2021-11-15 20:08 zhangtingxi 阅读(363) 评论(0) 推荐(0)