正文
增加 120 行删除 0 行
34 行未改动353637383940414279 行未改动122123124125126127128129398 行未改动全部展开52852953053134 行未改动| [P12169](https://www.luogu.com.cn/problem/P12169) |显然操作可逆,考虑并查集。只要存在一个逆序对,就有一对双向边。考虑优化,发现充要条件为 $pre_i>suf_{i+1}$,做完了。|[AC](https://www.luogu.com.cn/record/282504500)|| [P16939](https://www.luogu.com.cn/problem/P16939) | |[AC](https://www.luogu.com.cn/record/282700751)|| [P16717](https://www.luogu.com.cn/problem/P16717) | |[AC](https://www.luogu.com.cn/record/282700617)|| [P16952](https://www.luogu.com.cn/problem/P16952) |整个串是一个 $\text{00⋯0 11⋯1 0010010010⋯}$ 的结构,其中前两部分的长度均为$(n+4)/3$。|[AC](https://www.luogu.com.cn/record/282730332)|[2025 计划](https://www.luogu.me/article/8jemutw8):::align{center}79 行未改动| $\text{2026/6/21}$ ||[P12890](https://www.luogu.com.cn/problem/P12890),[P14989](https://www.luogu.com.cn/problem/P14989)|^|| $\text{2026/6/22}$ ||[P12890](https://www.luogu.com.cn/problem/P12890),[P14989](https://www.luogu.com.cn/problem/P14989)|^|| $\text{2026/6/23}$ ||[P14467](https://www.luogu.com.cn/problem/P14467),[P1204](https://www.luogu.com.cn/problem/P1204)|^|| $\text{2026/6/24}$ ||[P3901](https://www.luogu.com.cn/problem/P3901),[P16265](https://www.luogu.com.cn/problem/P16265)|^|:::align{center}## 做题记录:::398 行未改动全部展开| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P3901](https://www.luogu.com.cn/problem/P3901)|固定 $l$,合法 $r$ 构成一个区间。双指针即可。|[AC](https://www.luogu.com.cn/record/282868972)||[P16265](https://www.luogu.com.cn/problem/P16265)|水题。|[AC](https://www.luogu.com.cn/record/282871068)|34 行未改动35363738394041424379 行未改动123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155398 行未改动全部展开55455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065134 行未改动| [P12169](https://www.luogu.com.cn/problem/P12169) |显然操作可逆,考虑并查集。只要存在一个逆序对,就有一对双向边。考虑优化,发现充要条件为 $pre_i>suf_{i+1}$,做完了。|[AC](https://www.luogu.com.cn/record/282504500)|| [P16939](https://www.luogu.com.cn/problem/P16939) | |[AC](https://www.luogu.com.cn/record/282700751)|| [P16717](https://www.luogu.com.cn/problem/P16717) | |[AC](https://www.luogu.com.cn/record/282700617)|| [P16952](https://www.luogu.com.cn/problem/P16952) |整个串是一个 $\text{00⋯0 11⋯1 0010010010⋯}$ 的结构,其中前两部分的长度均为$(n+4)/3$。|[AC](https://www.luogu.com.cn/record/282730332)|| [P16243](https://www.luogu.com.cn/problem/P16243) (2026/7/2)|每次相当于选择一个数,给它丢到最前面。考虑倒着做,就是将乱序还原,贪心即为最优方案。推式子,上树状数组即可。|[AC](https://www.luogu.com.cn/record/283643964)|[2025 计划](https://www.luogu.me/article/8jemutw8):::align{center}79 行未改动| $\text{2026/6/21}$ ||[P12890](https://www.luogu.com.cn/problem/P12890),[P14989](https://www.luogu.com.cn/problem/P14989)|^|| $\text{2026/6/22}$ ||[P12890](https://www.luogu.com.cn/problem/P12890),[P14989](https://www.luogu.com.cn/problem/P14989)|^|| $\text{2026/6/23}$ ||[P14467](https://www.luogu.com.cn/problem/P14467),[P1204](https://www.luogu.com.cn/problem/P1204)|^|| $\text{2026/6/24}$ ||[P3901](https://www.luogu.com.cn/problem/P3901),[P16265](https://www.luogu.com.cn/problem/P16265)|^|| $\text{2026/6/25}$ ||[P6801](https://www.luogu.com.cn/problem/P6801),[P6627](https://www.luogu.com.cn/problem/P6627)|^|| $\text{2026/6/26}$ ||[P9350](https://www.luogu.com.cn/problem/P9350),[P15029](https://www.luogu.com.cn/problem/P15029)|^|| $\text{2026/6/27}$ ||[P11849](https://www.luogu.com.cn/problem/P11849),[P11112](https://www.luogu.com.cn/problem/P11112),[P12728](https://www.luogu.com.cn/problem/P12728),[P8812](https://www.luogu.com.cn/problem/P8812),[P12877](https://www.luogu.com.cn/problem/P12877)|^|| $\text{2026/6/28}$ ||[P12928](https://www.luogu.com.cn/problem/P12928),[P15445](https://www.luogu.com.cn/problem/P15445)|^|| $\text{2026/6/29}$ ||[P10878](https://www.luogu.com.cn/problem/P10878),[P10804](https://www.luogu.com.cn/problem/P10804)|^|| $\text{2026/6/30}$ ||[P12501](https://www.luogu.com.cn/problem/P12501),[P16267](https://www.luogu.com.cn/problem/P16267)|$\small{\color{green}{普及+/提高-}}$|| $\text{2026/7/1}$ ||[P16272](https://www.luogu.com.cn/problem/P16272),[P14299](https://www.luogu.com.cn/problem/P14299)|^|| $\text{2026/8/21}$ |【8】数位DP|[P13085](https://www.luogu.com.cn/problem/P13085),[P12884](https://www.luogu.com.cn/problem/P12884)|$\small{\color{green}{普及+/提高-}} \sim \small{\color{cyan}{提高}}$|| $\text{2026/8/22}$ |【无】差分约束|[P6145](https://www.luogu.com.cn/problem/P6145),[P5960](https://www.luogu.com.cn/problem/P5960),[P3275](https://www.luogu.com.cn/problem/P3275),[P7624](https://www.luogu.com.cn/problem/P7624)|$\small{\color{yellow}{普及}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/8/23}$ |【6】排列组合|[B3901](https://www.luogu.com.cn/problem/B3901),[P1350](https://www.luogu.com.cn/problem/P1350),[P5520](https://www.luogu.com.cn/problem/P5520),[P11380](https://www.luogu.com.cn/problem/P11380),[P11250](https://www.luogu.com.cn/problem/P11250),[P10112](https://www.luogu.com.cn/problem/P10112),[P10263](https://www.luogu.com.cn/problem/P10263)|$\small{\color{yellow}{普及}}$|| $\text{2026/8/24}$ |【6】矩阵|[P7318](https://www.luogu.com.cn/problem/P7318),[P3390](https://www.luogu.com.cn/problem/P3390),[P1397](https://www.luogu.com.cn/problem/P1397),[P6569](https://www.luogu.com.cn/problem/P6569)|$\small{\color{yellow}{普及}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/8/27}$ |【6】树状数组|[P1908](https://www.luogu.com.cn/problem/P1908),[P5200](https://www.luogu.com.cn/problem/P5200),[P3374](https://www.luogu.com.cn/problem/P3374),[P1972](https://www.luogu.com.cn/problem/P1972),[P2161](https://www.luogu.com.cn/problem/P2161)|$\small{\color{yellow}{普及}} \sim \small{\color{cyan}{提高}}$|| $\text{2026/8/28}$ |【无】树状数组优化DP|[P2418](https://www.luogu.com.cn/problem/P2418),[P9415](https://www.luogu.com.cn/problem/P9415),[P9400](https://www.luogu.com.cn/problem/P9400),[P1545](https://www.luogu.com.cn/problem/P1545)|$\small{\color{cyan}{提高}}$|| $\text{2026/9/5}$ |【6】矩阵|[P5550](https://www.luogu.com.cn/problem/P5550),[P1338](https://www.luogu.com.cn/problem/P1338),[P2044](https://www.luogu.com.cn/problem/P2044),[P4159](https://www.luogu.com.cn/problem/P4159)|$\small{\color{yellow}{普及}} \sim \small{\color{cyan}{提高}}$|| $\text{2026/9/6}$ |【6】前缀和+差分|[P2843](https://www.luogu.com.cn/problem/P2843),[P10453](https://www.luogu.com.cn/problem/P10453),[P5920](https://www.luogu.com.cn/problem/P5920),[P10266](https://www.luogu.com.cn/problem/P10266)|^|| $\text{2026/9/7}$ |【】图论专题|[P11762](https://www.luogu.com.cn/problem/P11762),[P10193](https://www.luogu.com.cn/problem/P10193),[P11860](https://www.luogu.com.cn/problem/P11860),[P10941](https://www.luogu.com.cn/problem/P10941)|$\small{\color{green}{普及+/提高-}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/9/8}$ |【】字符串专题|[P11226](https://www.luogu.com.cn/problem/P11226),[P10581](https://www.luogu.com.cn/problem/P10581),[P11749](https://www.luogu.com.cn/problem/P11749),[P12213](https://www.luogu.com.cn/problem/P12213)|$\small{\color{cyan}{提高}}$|| $\text{2026/9/9}$ |【】线段树专题|[P12502](https://www.luogu.com.cn/problem/P12502),[P12579](https://www.luogu.com.cn/problem/P12579),[P12500](https://www.luogu.com.cn/problem/P12500),[P12263](https://www.luogu.com.cn/problem/P12263)|$\small{\color{cyan}{提高}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/9/10}$ |【】DP专题|[P10406](https://www.luogu.com.cn/problem/P10406),[P10767](https://www.luogu.com.cn/problem/P10767),[P11018](https://www.luogu.com.cn/problem/P11018),[P11294](https://www.luogu.com.cn/problem/P11294)|$\small{\color{cyan}{提高}}$||$\text{2026/10/7}$|CSP-S2024|[P11231](https://www.luogu.com.cn/problem/P11231),[P11232](https://www.luogu.com.cn/problem/P11232),[P11233](https://www.luogu.com.cn/problem/P11233),[P11234](https://www.luogu.com.cn/problem/P11234)|$\small{\color{orange}{普及-}} \sim \small{\color{black}{NOI/NOI+/CTS}}$||$\text{2026/10/8}$|CSP-S2025|[P14361](https://www.luogu.com.cn/problem/P14361),[P14362](https://www.luogu.com.cn/problem/P14362),[P14363](https://www.luogu.com.cn/problem/P14363),[P14364](https://www.luogu.com.cn/problem/P14364)|$\small{\color{yellow}{普及}} \sim \small{\color{purple}{省选/NOI-}}$||$\text{2026/10/9}$|CSP-S模拟1|[T1](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260101),[T2](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260102),[T3](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260103),[T4](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260104)|||$\text{2026/10/10}$|CSP-S模拟2|[T1](https://oj.xinxingshe.cn:444/d/xxs/p/CSP260201),[T2](https://oj.xinxingshe.cn:444/d/xxs/p/CSP260202),[T3](https://oj.xinxingshe.cn:444/d/xxs/p/CSP260203),[T4](https://oj.xinxingshe.cn:444/d/xxs/p/CSP260204)|||$\text{2026/10/11}$|CSP-S模拟3|[T1](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260305),[T2](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260302),[T3](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260303),[T4](https://oj.xinxingshe.cn:444/d/xxs/p/NOIP260304)|:::align{center}## 做题记录:::398 行未改动全部展开| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P3901](https://www.luogu.com.cn/problem/P3901)|固定 $l$,合法 $r$ 构成一个区间。双指针即可。|[AC](https://www.luogu.com.cn/record/282868972)||[P16265](https://www.luogu.com.cn/problem/P16265)|水题。|[AC](https://www.luogu.com.cn/record/282871068)|$\text{2026/6/25}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P6627](https://www.luogu.com.cn/problem/P6627)|设对幸运数字 $x$ 优惠 $a_x$。转为区间修改,离散化即可。|[AC](https://www.luogu.com.cn/record/282953867)||[P6801](https://www.luogu.com.cn/problem/P6801)|直接单调栈。|[AC](https://www.luogu.com.cn/record/282957656)|$\text{2026/6/26}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P15029](https://www.luogu.com.cn/problem/P15029)|直接双指针。|[AC](https://www.luogu.com.cn/record/283059255)||[P9350](https://www.luogu.com.cn/problem/P9350)|先拆绝对值,然后单调栈。|[AC](https://www.luogu.com.cn/record/283070917)|$\text{2026/6/27}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P11849](https://www.luogu.com.cn/problem/P11849)|首先将选择一个的情况视为选择了两个一样的数,然后考虑利用双指针二分答案。|[AC](https://www.luogu.com.cn/record/283132184)||[P11112](https://www.luogu.com.cn/problem/P11112)|在开始复制不劣,直接计算。|[AC](https://www.luogu.com.cn/record/283137769)||[P12728](https://www.luogu.com.cn/problem/P12728)|DP+前缀和。|[AC](https://www.luogu.com.cn/record/283149509)||[P8812](https://www.luogu.com.cn/problem/P8812)|记录所有物品在哪一天开始打折,在哪一天结束打折,显然只有这些点有用。暴力所有物品未打折的最小值,枚举每一天记录贡献。|[AC](https://www.luogu.com.cn/record/283166355)||[P12877](https://www.luogu.com.cn/problem/P12877)|$x=\frac{\sum b_i-\sum a_i}{n}$,若 $x$ 非整数则无解。令 $c_i=b_i-x$,则问题即为将 $a_i$ 循环左移变成 $c_i$,使用你喜欢的 最小表示法/KMP/哈希 即可。|[AC](https://www.luogu.com.cn/record/283205372)|$\text{2026/6/28}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P15445](https://www.luogu.com.cn/problem/P15445)|直接打表。|[AC](https://www.luogu.com.cn/record/283316220)||[P12928](https://www.luogu.com.cn/problem/P12928)|水题。|[AC](https://www.luogu.com.cn/record/282558109)|$\text{2026/6/29}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P10804](https://www.luogu.com.cn/problem/P10804)|直接搜索,使用前缀和优化。|[AC](https://www.luogu.com.cn/record/283377372)||[P10878](https://www.luogu.com.cn/problem/P10878)|先把操作一用完是最优的,考虑操作的意义,使用线段树维护。|[AC](https://www.luogu.com.cn/record/283377448)|$\text{2026/6/30}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16267](https://www.luogu.com.cn/problem/P16267)|单调栈预处理左右边界,枚举区间长度位数预处理。|[AC](https://www.luogu.com.cn/record/283447226)||[P12501](https://www.luogu.com.cn/problem/P12501)|水题。|[AC](https://www.luogu.com.cn/record/283452327)|$\text{2026/7/1}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16272](https://www.luogu.com.cn/problem/P16272)|直接暴力。|[AC](https://www.luogu.com.cn/record/283549219)||[P14299](https://www.luogu.com.cn/problem/P14299)|水题。|[AC](https://www.luogu.com.cn/record/283549278)|$\text{2026/8/21}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P13085](https://www.luogu.com.cn/problem/P13085)|答案显然可以拆成 $\le b \text{的个数}-\le a-1 \text{的个数}$。令 $f_{i,j}$ 表示 $i$ 位且以最高位为数字 $j$ 的 windy 数的个数。位数小于 $a$ 的可以直接累加,等于的按和 $a$ 的前几位重合逐个计算即可。|[AC](https://www.luogu.com.cn/record/294444496)||[P12884](https://www.luogu.com.cn/problem/P12884)|设 $dp_{pos,sum,la,t}$,意义:处理到第几位,所有的相邻数位之间的差值的绝对值之和,上一位(前面全为0时记为10),是否和 $n$ 的前 $pos$ 位重合。直接记搜即可。|[AC](https://www.luogu.com.cn/record/294514850)|$\text{2026/8/22}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P6145](https://www.luogu.com.cn/problem/P6145)|模板,注意不要只入队入度为 0 的点。|[AC](https://www.luogu.com.cn/record/294548601)||[P5960](https://www.luogu.com.cn/problem/P5960)|^|[AC](https://www.luogu.com.cn/record/294553545)||[P3275](https://www.luogu.com.cn/problem/P3275)|建边是简单的。SPFA 被卡了,考虑使用缩点。对缩点后 DAG 拓扑排序即可求出答案。|[AC](https://www.luogu.com.cn/record/294582466)||[P7624](https://www.luogu.com.cn/problem/P7624)|对于一个环直接断环成链,设 $D_i$ 表示从 $1$ 号车站到 $i$ 号车站的距离,和总环长 $C$。可行的 $C$ 显然连续。差分约束,无负环时调整简单,存在负环,我们找到这个负环代表式中的 $k_p$ 即可判定方向。|[AC](https://www.luogu.com.cn/record/294662858)|$\text{2026/8/23}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P10263](https://www.luogu.com.cn/problem/P10263)|水题。|[AC](https://www.luogu.com.cn/record/294771865)||[P10112](https://www.luogu.com.cn/problem/P10112)|^|[AC](https://www.luogu.com.cn/record/294775395)||[P11250](https://www.luogu.com.cn/problem/P11250)|^|[AC](https://www.luogu.com.cn/record/294780132)||[P11380](https://www.luogu.com.cn/problem/P11380)|^|[AC](https://www.luogu.com.cn/record/294965178)||[B3901](https://www.luogu.com.cn/problem/B3901)|^|[AC](https://www.luogu.com.cn/record/294969620)||[P1350](https://www.luogu.com.cn/problem/P1350)|^|[AC](https://www.luogu.com.cn/record/294971802)||[P5520](https://www.luogu.com.cn/problem/P5520)|^|[AC](https://www.luogu.com.cn/record/294971054)|$\text{2026/8/24}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P7318](https://www.luogu.com.cn/problem/P7318)|水题。|[AC](https://www.luogu.com.cn/record/294974422)||[P3390](https://www.luogu.com.cn/problem/P3390)|^|[AC](https://www.luogu.com.cn/record/294780132)|$\text{2026/8/24}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P2843](https://www.luogu.com.cn/problem/P2843)|简单题,注意等价条件为相对值相同,使用 `map<vector<int>,int>` 即可。|[AC](https://www.luogu.com.cn/record/296956748)||其余题目|暂无|[2](https://www.luogu.com.cn/record/296969949),[3](https://www.luogu.com.cn/record/296969966),[4](https://www.luogu.com.cn/record/296970168)|