正文
增加 329 行删除 0 行
29 行未改动303132333435363713 行未改动515253545556575830 行未改动8990919293949596222 行未改动全部展开31932032132229 行未改动| [P1360](https://www.luogu.com.cn/problem/P1360) |水题。|[AC](https://www.luogu.com.cn/record/268187386)|| [P1468](https://www.luogu.com.cn/problem/P1468) | | || [P15862](https://www.luogu.com.cn/problem/P15862) |枚举起点,此时如果一直前进,路径是固定的。枚举第 $k+1$ 步在序列上的哪里,然后考虑 $dp$。设 $f_{i,a,b}$ 表示第 $i$ 步在 $a$,第 $k+i$ 步在 $b$ 的概率,字符相同才能转移,转移显然是 $O(1)$ 的。|[AC](https://www.luogu.com.cn/record/269209968)|| [P8866](https://www.luogu.com.cn/problem/P8866) |[构造难题](https://www.luogu.com.cn/article/kw7wu8sy)|[AC](https://www.luogu.com.cn/record/269804824)|[2025 计划](https://www.luogu.me/article/8jemutw8):::align{center}13 行未改动| $\text{2026/3/21}$ | [LGR-274-Div.2](https://www.luogu.com.cn/contest/293373) |T1 题解:找到最大正整数 $n$,使得 $m \ge \dfrac{n\times (n-1)}2$,在 $n$ 个 $1$ 中插入一个 $2$ 调整。T3 部分分:设 $dp_{i,j,k}$ 表示决定 $i$ 个位置,与其相关的两个区间现在的和,暴力转移。特殊性质如果位置未被覆盖,直接 `*2`,如果被覆盖,使用组合数计算该区间。|${\color{red}{+22}}\, 95/1284$|| ^ | [ABC450](https://atcoder.jp/contests/abc450) |D 题解:先将 $a_i \gets a_i \bmod k$。答案为 $\min\{a_n-a_1,\min_{i=1}^n(a_i+k-a_{i+1})\}$。E 题解:预处理串长(直到 $\ge 10^{18}$),$x,y$ 字符的前缀和,$s_x$ 的字符出现次数 $c_{i,c}$,递归处理询问,如果出现整串,使用 $c_{i,c}$ 快速计算,时间复杂度为 $O(Q \log V)$(其中 $V=10^{18}$)|${\color{red}{+17}}\, 1553/10935 $|| $\text{2026/3/28}$ | [LGR-276-Div.3](https://www.luogu.com.cn/contest/314564) |D 题解:如果 $x>y$,$ans=y\times(1+2^{x-y-1})$,否则 $ans=1$。E 题解:$ans=\max_{i=1}^n\min[m-(\sum_{j=0}^{i-1} c_j),\text{前} \min(k,i) \text{大的}a_{1\sim i}]$|${\color{red}{+22}}\, 218/2916$|| ^ | [ABC451](https://atcoder.jp/contests/abc451) | |${\color{red}{+27}}\, 1198/10783$|:::align{center}## 计划表:::30 行未改动| $\text{2026/4/14}$ |^|[P5628](https://www.luogu.com.cn/problem/P5628),[P3312](https://www.luogu.com.cn/problem/P3312),[P3166](https://www.luogu.com.cn/problem/P3166)|$\small{\color{green}{普及+/提高}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/4/15}$ |^|[P11899](https://www.luogu.com.cn/problem/P11899),[P16141](https://www.luogu.com.cn/problem/P16141),[P15423](https://www.luogu.com.cn/problem/P15423)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/4/17}$ |【】DP 杂项|[P3558](https://www.luogu.com.cn/problem/P3558),[P4395](https://www.luogu.com.cn/problem/P4395),[P10880](https://www.luogu.com.cn/problem/P10880)|$\small{\color{green}{普及+/提高}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/4/19}$ |^|[P2467](https://www.luogu.com.cn/problem/P2467),[P3146](https://www.luogu.com.cn/problem/P3146),[P5363](https://www.luogu.com.cn/problem/P5363)|^|:::align{center}## 做题记录:::222 行未改动全部展开| :--: | :-: | :---: ||[P3146](https://www.luogu.com.cn/problem/P3146)|定义状态 $f_{i,k}$,表示第 $i$ 个数合并得到数值为 $k$,能够向右拓展的最右端点。|[AC](https://www.luogu.com.cn/record/274855695)||[P2467](https://www.luogu.com.cn/problem/P2467)|$dp_{i,j}$ 表示数列中有 $i$ 个数,第一个数为山顶且是 $j$。|[AC](https://www.luogu.com.cn/record/274944530)||[P5363](https://www.luogu.com.cn/problem/P5363)| |[AC](https://www.luogu.com.cn/record/274943459)|29 行未改动303132333435363738394041424313 行未改动5758596061626364656630 行未改动979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154222 行未改动全部展开37737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065129 行未改动| [P1360](https://www.luogu.com.cn/problem/P1360) |水题。|[AC](https://www.luogu.com.cn/record/268187386)|| [P1468](https://www.luogu.com.cn/problem/P1468) | | || [P15862](https://www.luogu.com.cn/problem/P15862) |枚举起点,此时如果一直前进,路径是固定的。枚举第 $k+1$ 步在序列上的哪里,然后考虑 $dp$。设 $f_{i,a,b}$ 表示第 $i$ 步在 $a$,第 $k+i$ 步在 $b$ 的概率,字符相同才能转移,转移显然是 $O(1)$ 的。|[AC](https://www.luogu.com.cn/record/269209968)|| [P8866](https://www.luogu.com.cn/problem/P8866) |[构造难题](https://www.luogu.com.cn/article/kw7wu8sy)|[AC](https://www.luogu.com.cn/record/269804824)|| [P12458](https://www.luogu.com.cn/problem/P12458) |先枚举 $a$。显然最优的 $c$ 只可能是 $\max\{C\}/\min\{C\}$。考虑 Bob 选择 $b$,需要 $a+b+\min\{C\}/a+b+\max\{C\}$ 均匀分布在两侧。|[AC](https://www.luogu.com.cn/record/282478422)|| [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}13 行未改动| $\text{2026/3/21}$ | [LGR-274-Div.2](https://www.luogu.com.cn/contest/293373) |T1 题解:找到最大正整数 $n$,使得 $m \ge \dfrac{n\times (n-1)}2$,在 $n$ 个 $1$ 中插入一个 $2$ 调整。T3 部分分:设 $dp_{i,j,k}$ 表示决定 $i$ 个位置,与其相关的两个区间现在的和,暴力转移。特殊性质如果位置未被覆盖,直接 `*2`,如果被覆盖,使用组合数计算该区间。|${\color{red}{+22}}\, 95/1284$|| ^ | [ABC450](https://atcoder.jp/contests/abc450) |D 题解:先将 $a_i \gets a_i \bmod k$。答案为 $\min\{a_n-a_1,\min_{i=1}^n(a_i+k-a_{i+1})\}$。E 题解:预处理串长(直到 $\ge 10^{18}$),$x,y$ 字符的前缀和,$s_x$ 的字符出现次数 $c_{i,c}$,递归处理询问,如果出现整串,使用 $c_{i,c}$ 快速计算,时间复杂度为 $O(Q \log V)$(其中 $V=10^{18}$)|${\color{red}{+17}}\, 1553/10935 $|| $\text{2026/3/28}$ | [LGR-276-Div.3](https://www.luogu.com.cn/contest/314564) |D 题解:如果 $x>y$,$ans=y\times(1+2^{x-y-1})$,否则 $ans=1$。E 题解:$ans=\max_{i=1}^n\min[m-(\sum_{j=0}^{i-1} c_j),\text{前} \min(k,i) \text{大的}a_{1\sim i}]$|${\color{red}{+22}}\, 218/2916$|| ^ | [ABC451](https://atcoder.jp/contests/abc451) | |${\color{red}{+27}}\, 1198/10783$|| $\text{2026/4/25}$ | [ABC455](https://atcoder.jp/contests/abc455) |E 题解:记 $preA[i],preB[i],preC[i]$ 为前 $i$ 个字符的出现次数。记录差,使用容斥即可。||| $\text{2026/6/19}$ | [LAOIR18](https://www.luogu.com.cn/contest/265057#description) |B 题解:注意到最小割等于最小度数,最小度数肯定在点 3 取到,$ans=n-2-\lfloor n/3 \rfloor$。C 题解: 锁定 $a=1$,找出一堆满足条件的 $(b, c)$。在这些 $(b, c)$ 中,检查 $a=2,3$ 。找出后验证。K 题解:转为最大子段和。||:::align{center}## 计划表:::30 行未改动| $\text{2026/4/14}$ |^|[P5628](https://www.luogu.com.cn/problem/P5628),[P3312](https://www.luogu.com.cn/problem/P3312),[P3166](https://www.luogu.com.cn/problem/P3166)|$\small{\color{green}{普及+/提高}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/4/15}$ |^|[P11899](https://www.luogu.com.cn/problem/P11899),[P16141](https://www.luogu.com.cn/problem/P16141),[P15423](https://www.luogu.com.cn/problem/P15423)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/4/17}$ |【】DP 杂项|[P3558](https://www.luogu.com.cn/problem/P3558),[P4395](https://www.luogu.com.cn/problem/P4395),[P10880](https://www.luogu.com.cn/problem/P10880)|$\small{\color{green}{普及+/提高}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/4/19}$ |^|[P2467](https://www.luogu.com.cn/problem/P2467),[P3146](https://www.luogu.com.cn/problem/P3146),[P5363](https://www.luogu.com.cn/problem/P5363)|^|| $\text{2026/5/1}$ |【9】构造|[P16254](https://www.luogu.com.cn/problem/P16254),[P16344](https://www.luogu.com.cn/problem/P16344),[P15653](https://www.luogu.com.cn/problem/P15653)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{black}{NOI/NOI+/CTSC}}$|| $\text{2026/5/2}$ |【无】矩阵加速|[P4031](https://www.luogu.com.cn/problem/P4031),[P1357](https://www.luogu.com.cn/problem/P1357)|$\small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/4}$ |【8】数位 DP|[P13085](https://www.luogu.com.cn/problem/P13085),[P16140](https://www.luogu.com.cn/problem/P16140),[P16258](https://www.luogu.com.cn/problem/P16258)|$\small{\color{green}{普及+/提高}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/17}$ |【6】并查集|[P16495](https://www.luogu.com.cn/problem/P16495),[P1621](https://www.luogu.com.cn/problem/P1621),[P2391](https://www.luogu.com.cn/problem/P2391)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/18}$ |^|[P6691](https://www.luogu.com.cn/problem/P6691),[P8779](https://www.luogu.com.cn/problem/P8779),[P2294](https://www.luogu.com.cn/problem/P2294)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{green}{普及+/提高}}$|| $\text{2026/5/19}$ |【6】MST|[P15369](https://www.luogu.com.cn/problem/P15369),[P12375](https://www.luogu.com.cn/problem/P12375),[P14548](https://www.luogu.com.cn/problem/P14548)|$\small{\color{green}{普及+/提高}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/20}$ |^|[P3790](https://www.luogu.com.cn/problem/P3790),[P4826](https://www.luogu.com.cn/problem/P4826)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/5/21}$ |【6】欧拉回路|[P11762](https://www.luogu.com.cn/problem/P11762),[P13348](https://www.luogu.com.cn/problem/P13348),[P7771](https://www.luogu.com.cn/problem/P7771)|$\small{\color{green}{普及+/提高}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/23}$ |【/】字符串|[P15561](https://www.luogu.com.cn/problem/P15561),[P15767](https://www.luogu.com.cn/problem/P15767),[P16287](https://www.luogu.com.cn/problem/P16287)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/26}$ |^|[P8853](https://www.luogu.com.cn/problem/P8853),[P9089](https://www.luogu.com.cn/problem/P9089),[P9149](https://www.luogu.com.cn/problem/P9149)|$ \small{\color{blue}{提高+/省选-}}$|| $\text{2026/5/27}$ |^|[P11291](https://www.luogu.com.cn/problem/P11291),[P12977](https://www.luogu.com.cn/problem/P12977)|$\small{\color{purple}{省选/NOI-}}$|| $\text{2026/5/28}$ |^|[P15650](https://www.luogu.com.cn/problem/P15650),[P13790](https://www.luogu.com.cn/problem/P13790)|$ \small{\color{blue}{提高+/省选-}} \sim \small{\color{black}{NOI/NOI+/CTSC}}$|| $\text{2026/6/9}$ |【8】序列分块|[P16524](https://www.luogu.com.cn/problem/P16524),[P12536](https://www.luogu.com.cn/problem/P12536),[P3793](https://www.luogu.com.cn/problem/P3793)|^|| $\text{2026/6/10}$ |【8】数论分块|[P12021](https://www.luogu.com.cn/problem/P12021),[P12181](https://www.luogu.com.cn/problem/P12181)|$\small{\color{green}{普及+/提高}} \sim \small{\color{blue}{提高+/省选-}}$|| $\text{2026/6/11}$ |【无】根号分治|[P1483](https://www.luogu.com.cn/problem/P1483),[P2425](https://www.luogu.com.cn/problem/P2425),[P16522](https://www.luogu.com.cn/problem/P16522)|^|| $\text{2026/6/12}$ |【无】莫队|[P12003](https://www.luogu.com.cn/problem/P12003),[P2709](https://www.luogu.com.cn/problem/P2709),[P7252](https://www.luogu.com.cn/problem/P7252)|$ \small{\color{blue}{提高+/省选-}} \sim \small{\color{purple}{省选/NOI-}}$|| $\text{2026/6/13}$ |【无】DDP|[P4719](https://www.luogu.com.cn/problem/P4719),[P15324](https://www.luogu.com.cn/problem/P15324)|$\small{\color{purple}{省选/NOI-}}$|| $\text{2026/6/15}$ | |[P16634](https://www.luogu.com.cn/problem/P16634),[P16732](https://www.luogu.com.cn/problem/P16732),[P16882](https://www.luogu.com.cn/problem/P16882)|$\small{\color{yellow}{普及/提高-}}$|| $\text{2026/6/16}$ |^|[P16744](https://www.luogu.com.cn/problem/P16744),[P16593](https://www.luogu.com.cn/problem/P16593),[P16614](https://www.luogu.com.cn/problem/P16614),[P16521](https://www.luogu.com.cn/problem/P16521),[P16743](https://www.luogu.com.cn/problem/P16743)|$\small{\color{yellow}{普及/提高-}} \sim \small{\color{green}{普及+/提高}}$|| $\text{2026/6/17}$ | |[P16757](https://www.luogu.com.cn/problem/P16757),[P16622](https://www.luogu.com.cn/problem/P16622),[P16585](https://www.luogu.com.cn/problem/P16585)|$\small{\color{yellow}{普及/提高-}}$|| $\text{2026/6/18}$ | |[P16617](https://www.luogu.com.cn/problem/P16617),[P16741](https://www.luogu.com.cn/problem/P16741)|^|| $\text{2026/6/19}$ | |[P16239](https://www.luogu.com.cn/problem/P16239),[P16808](https://www.luogu.com.cn/problem/P16808),[B4473](https://www.luogu.com.cn/problem/B4473),[P14798](https://www.luogu.com.cn/problem/P14798),[P12261](https://www.luogu.com.cn/problem/P12261)|$\small{\color{green}{普及+/提高}}$|| $\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}## 做题记录:::222 行未改动全部展开| :--: | :-: | :---: ||[P3146](https://www.luogu.com.cn/problem/P3146)|定义状态 $f_{i,k}$,表示第 $i$ 个数合并得到数值为 $k$,能够向右拓展的最右端点。|[AC](https://www.luogu.com.cn/record/274855695)||[P2467](https://www.luogu.com.cn/problem/P2467)|$dp_{i,j}$ 表示数列中有 $i$ 个数,第一个数为山顶且是 $j$。|[AC](https://www.luogu.com.cn/record/274944530)||[P5363](https://www.luogu.com.cn/problem/P5363)| |[AC](https://www.luogu.com.cn/record/274943459)|$\text{2026/5/4}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P13085](https://www.luogu.com.cn/problem/P13085)|令 $f[i][j]$ 表示 $i$ 位且以最高位为数字 $j$ 的 windy 数的个数。枚举第二位的数字得到:$\displaystyle f[i][j]=\sum_{k=\max(j-2,0)}^{\min(j+2,9)} f[i-1][k]$。假设我们要求小于等于一个数 $a$ 的 windy 数个数,设其为 $m$ 位,其第 $i$ 位表示为 $r_i$,$a$ 的前 $l$ 位均满足 windy 数的性质。则 $ans=\displaystyle \sum_{i=1}^{m-1}\sum_{j=1}^9 f[i][j]+\sum_{i=1}^{l+1}\sum_{j=1}^{\min(r_i-1,r_{i-1}-2)}f[i][j]$。|[AC](https://www.luogu.com.cn/record/276621717)||[P16258](https://www.luogu.com.cn/problem/P16258)|[设 $S(a)$ 为 $a_{i-1}+a_i$($i=2,3,\dots,L$)的异或和。所以 $S(a_{(k)})=(k+k-1)\operatorname{xor}S(a_{(k-1)})\operatorname{xor}(1+k-2)\operatorname{xor}S(a_{(k-2)})$。即 $S_k=S_{k-1}\operatorname{xor}S_{k-2}\operatorname{xor}k\operatorname{xor}(k-2)\operatorname{xor}(2k-1)$。在 $S_k$ 的式子中代入 $S_{k-1}$:$S_k=S_{k-3}\operatorname{xor}k\operatorname{xor}(k-1)\operatorname{xor}(k-2)\operatorname{xor}(k-3)\operatorname{xor}(2k-1)\operatorname{xor}(2k-3)$。核心问题转化为:对于一个 $x$,求$f(x)=\operatorname{xor}_{n\ge 0,x-3n>0}(x-3n)$。设 $dp_{i,k}$ 为所有 $<2^i$ 且模 $3$ 余 $k$ 的自然数的异或和即可。](https://www.luogu.com.cn/article/y9h39q2a)|[AC](https://www.luogu.com.cn/record/276651898)|$\text{2026/5/17}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16495](https://www.luogu.com.cn/problem/P16495)|直接取反,然后可以 $O(n^2)$ 建图,因为可以走回头路所以答案就是连通块数。但是这个复杂度肯定不能过,考虑优化建图。显然我们可以对每个 $2^k$ 建虚点,然后把边往上面连来判连通块数,并查集维护一下就好。注意对于孤点($a_i=2^n-1$)需要特判。|[AC](https://www.luogu.com.cn/record/278316310)||[P1621](https://www.luogu.com.cn/problem/P1621)|枚举大于等于 p 的素数的倍数直接合并。|[AC](https://www.luogu.com.cn/record/278316310)||[P2391](https://www.luogu.com.cn/problem/P2391)|水题。|[AC](https://www.luogu.com.cn/record/278439604)|$\text{2026/5/18}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P6691](https://www.luogu.com.cn/problem/P6691)|带权并查集模板。|[AC](https://www.luogu.com.cn/record/278487891)||[P8779](https://www.luogu.com.cn/problem/P8779)|不难想到一个思路:对于给定的一个区间 $ [l,r] $,建无向边 $ (l-1,r) $,代表由 $ sum_r $ 的信息能推出 $ sum_{l-1} $ 的信息,反之亦然。于是我们已知 $ sum_0=0 $,对于一个询问,问题转化为从图上的 $ l-1 $ 节点能否到达 $ r $。这个可以直接用并查集维护。当两个端点不连通则代表无解。使用带权并查集即可。|[AC](https://www.luogu.com.cn/record/278488107)||[P2294](https://www.luogu.com.cn/problem/P2294)|水题。|[AC](https://www.luogu.com.cn/record/278488121)|$\text{2026/5/19}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P15369](https://www.luogu.com.cn/problem/P15369)|见杂项。|[AC](https://www.luogu.com.cn/record/278584884)||[P12375](https://www.luogu.com.cn/problem/P12375)|$ans=\frac{(x^2 - 2x + 6)(x - 1)}{6} + \frac{(n - x)(2m - n + x + 1)}{2}$|[AC](https://www.luogu.com.cn/record/278587311)||[P14548](https://www.luogu.com.cn/problem/P14548)|水题。|[AC](https://www.luogu.com.cn/record/278587414)|$\text{2026/5/20}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P3790](https://www.luogu.com.cn/problem/P3790)|水题。|[AC](https://www.luogu.com.cn/record/278693005)||[P4826](https://www.luogu.com.cn/problem/P4826)|预处理出每两头牛对局的得分,跑一次最大生成树即可。|[AC](https://www.luogu.com.cn/record/278685342)|$\text{2026/5/21}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P7771](https://www.luogu.com.cn/problem/P7771)|板子。|[AC](https://www.luogu.com.cn/record/278796951)||[P13348](https://www.luogu.com.cn/problem/P13348)|简单构造。|[AC](https://www.luogu.com.cn/record/278797804)||[P11762](https://www.luogu.com.cn/problem/P13348)|问题可转化成给定一个图,通过添加 $\le n$ 条重边使其成为欧拉图。|[AC](https://www.luogu.com.cn/record/278798247)|$\text{2026/5/23}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16287](https://www.luogu.com.cn/problem/P16287)|处理出一个单词进行下面两种变换之一得到的单词,使用 `map` 处理答案。|[AC](https://www.luogu.com.cn/record/279057799)||[P15767](https://www.luogu.com.cn/problem/P15767)|水题。|[AC](https://www.luogu.com.cn/record/279093010)||[P15561](https://www.luogu.com.cn/problem/P15561)|将 `w` 拆成 `vv`,但是要注意计算贡献时,用合并记作贡献为一,且不允许单独拆分。处理办法为:将记录贡献、“是否有拆开的 `w` 的变量”单开两个数组来算。|[AC](https://www.luogu.com.cn/record/279136256)|$\text{2026/5/26}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P9149](https://www.luogu.com.cn/problem/P9149)|水题。|[AC](https://www.luogu.com.cn/record/279500985)||[P9089](https://www.luogu.com.cn/problem/P9089)|^|[AC](https://www.luogu.com.cn/record/279513547)|$\text{2026/5/27}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P12977](https://www.luogu.com.cn/problem/P12977)|对 Manacher 算法进行朴素地收缩的复杂度即为正确的。|[AC](https://www.luogu.com.cn/record/279609581)||[P11291](https://www.luogu.com.cn/problem/P11291)|简单题。|[AC](https://www.luogu.com.cn/record/279617789)|$\text{2026/5/28}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P15650](https://www.luogu.com.cn/problem/P15650)|根据乱搞直觉,注意到大样例有很多 `0`,不妨猜测下面两种形态即可构造出一种答案,$axsyb$ 和 $xasyb$,其中 $a,b$ 全 `0`,$len(x)+len(y) \le 11$。|[AC](https://www.luogu.com.cn/record/279707640)||[P13790](https://www.luogu.com.cn/problem/P13790)|考虑枚举 border 长度,问题就被转化成了给定一个字符串,每次给定两个子串,问是否只有 ≤1 处不同。因此考虑二分,再用哈希判断两个子串是否相等。|[AC](https://www.luogu.com.cn/record/279709009)|$\text{2026/6/9}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P3793](https://www.luogu.com.cn/problem/P3793)|分块,处理出每个元素块中前缀最大值和后缀最大值,并且处理出整块的区间最大值。若 $l,r$ 在同一块中,直接暴力查询。|[AC](https://www.luogu.com.cn/record/281269934)||[P16524](https://www.luogu.com.cn/problem/P16524)|简单分块。|[AC](https://www.luogu.com.cn/record/281271183)||[P12536](https://www.luogu.com.cn/problem/P12536)|换根是假的,对操作序列分块。|[AC](https://www.luogu.com.cn/record/281327708)|$\text{2026/6/10}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P12021](https://www.luogu.com.cn/problem/P12021)|水题。|[AC](https://www.luogu.com.cn/record/281400424)||[P12181](https://www.luogu.com.cn/problem/P12181)|^|[AC](https://www.luogu.com.cn/record/281400851)|$\text{2026/6/11}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P1483](https://www.luogu.com.cn/problem/P1483)|根号分治水题。|[AC](https://www.luogu.com.cn/record/281485024)||[P2425](https://www.luogu.com.cn/problem/P2425)|位数 $> 2$ 时暴力,否则简单讨论。|[AC](https://www.luogu.com.cn/record/281485391)||[P16522](https://www.luogu.com.cn/problem/P16522)|一条直线斜率 k 较大时在范围内过的整点很少,根号分治。|[AC](https://www.luogu.com.cn/record/281486189)|$\text{2026/6/12}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P7252](https://www.luogu.com.cn/problem/P1483)|板子。|[AC](https://www.luogu.com.cn/record/281554096)||[P2709](https://www.luogu.com.cn/problem/P2709)|^|[AC](https://www.luogu.com.cn/record/281554470)||[P12003](https://www.luogu.com.cn/problem/P12003)|分解质因数,树上莫队。卡常部分:在括号序上求质因数,而不是在原来的点上求,同时你把这一堆质因数放到同一个 vector 里,括号序上每个位置存对应的区间。这样莫队指针移动访问的内存就是连续的。|[AC](https://www.luogu.com.cn/record/281555678)|$\text{2026/6/13}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P4719](https://www.luogu.com.cn/problem/P4719)|重链剖分,划分出轻重儿子。定义类似的 dp 数组方便快速修改和查询这条链的 DP 值。使用 (+,max) 矩阵乘法,链上每个节点都对应着一个转移矩阵。一条重链内直接线段树维护区间*积。到了一条重链链头,因为这个点是它父亲的轻儿子,我们需要更新它父亲节点所在的点的转移矩阵。这样子一直跳到根节点就可以了。|[AC](https://www.luogu.com.cn/record/281735058)||[P15324](https://www.luogu.com.cn/problem/P15324)|长度为奇数的话 Alice 就爆炸了,判掉 $\{1\}$。Alice 每次只能删去一个 0,Bob 每次至少能够删除一个 1,两个连续的 1 一次就删了。能使 Alice 拥有必胜策略的序列表述为:两两分段后每段可以为 01,10,11,且所有 10 均在所有 01 之前。考虑 dp,记 $f_{i,0/1}$ 为前 $i$ 位,是否出现过 01 的方案数。我们每两位为一个单位转移,DDP 即可。|[AC](https://www.luogu.com.cn/record/281780813)|$\text{2026/6/15}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16882](https://www.luogu.com.cn/problem/P16882)|分别暴力+前缀和预处理出来从数组 A 和 B 拿 $i$ 个数可以获得的最大值 $best_i$ 。后续简单。|[AC](https://www.luogu.com.cn/record/282020418)||[P16634](https://www.luogu.com.cn/problem/P16634)|将 $N!$ 拆成 $1 \times 2 \times \cdots N$,分步快速幂。|[AC](https://www.luogu.com.cn/record/282025477)||[P16732](https://www.luogu.com.cn/problem/P16732)|简单性质题。|[AC](https://www.luogu.com.cn/record/2820260867)|$\text{2026/6/16}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16744](https://www.luogu.com.cn/problem/P16744)|答案 $h$ 具有单调性,记录 $cnt_i$,若 $sum-cnt_h \ge h+1$,将答案加一。|[AC](https://www.luogu.com.cn/record/282036473)||[P16593](https://www.luogu.com.cn/problem/P16593)|枚举 $1$ 的个数,然后二分找 $B$。|[AC](https://www.luogu.com.cn/record/282037215)||[P16614](https://www.luogu.com.cn/problem/P16614)|小学奥数。|[AC](https://www.luogu.com.cn/record/282037766)||[P16521](https://www.luogu.com.cn/problem/P16521)|查询次数很少,所以考虑单独处理每个查询。使用类似前缀和的方法求出结果:分别算出排名前 $r$ 的和与排名前 $l−1$ 的和,两者相减即可。考虑二分求排名恰好为 $k$ 的子数组和的值。对于一个子数组 $[l,r]$,它的和可以用前缀和 $O(1)$ 计算。左端点左移,子数组的和是单调不减的。这启示我们使用双指针算法。后续简单|[AC](https://www.luogu.com.cn/record/282055532)||[P16743](https://www.luogu.com.cn/problem/P16743)|折半搜索。|[AC](https://www.luogu.com.cn/record/282071357)|$\text{2026/6/17}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16757](https://www.luogu.com.cn/problem/P16757)|枚举所有完全平方数,使用前缀和分别统计。|[AC](https://www.luogu.com.cn/record/282175714)||[P16622](https://www.luogu.com.cn/problem/P16622)|$N=1$ 简单。定义 $dp_{p_1,p_2}$ 表示:在处理过程中,朋友 1 得了 $p_1$ 分、朋友 2 得了 $p_2$ 分的所有可能真实答案序列里,我能获得的最高分数。若状态不可达,值为 −1。|[AC](https://www.luogu.com.cn/record/282177329)||[P16585](https://www.luogu.com.cn/problem/P16585)|动态规划。|[AC](https://www.luogu.com.cn/record/282177361)|$\text{2026/6/18}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16741](https://www.luogu.com.cn/problem/P16741)|简单题。|[AC](https://www.luogu.com.cn/record/282223623)||[P16617](https://www.luogu.com.cn/problem/P16617)|推式子。|[AC](https://www.luogu.com.cn/record/282223761)|$\text{2026/6/19}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P16808](https://www.luogu.com.cn/problem/P16808)|二分最大的 $t$ 使 $(t+1)t/2 \le S$,显然,合法的 $n$ 在 $[t,t+L]$ 之间。连续丢卡的开始位置具有单调性,使用二分 check。|[AC](https://www.luogu.com.cn/record/282277351)||[P16239](https://www.luogu.com.cn/problem/P16239)|我们一定是把操作给到 $y/x$ 最大的那个 pair 上。为了满分,排序规则改成按 $x/y$,考虑直接二分所有操作结束后的$min(x/y)$ 的最大值。剩下的 $m$ 使用 60 分做法。|[AC](https://www.luogu.com.cn/record/282294694)||[B4473](https://www.luogu.com.cn/problem/B4473)|同上。|[AC](https://www.luogu.com.cn/record/282311430)||[P14798](https://www.luogu.com.cn/problem/P14798)|将数组 $A$ sort,计算前缀和以快速计算 $f$。设费用函数为 $f(x)$,显然其下凸,二分最小 $x$ 使 $f^{'}(x)\ge 0$,$f(x)$ 即为答案。|[AC](https://www.luogu.com.cn/record/282322744)||[P12261](https://www.luogu.com.cn/problem/P12261)|定义 $f(x)$ 为x坐标为 $x$ 的满足条件的最短挡板的长度。显然其下凸,直接三分。|[AC](https://www.luogu.com.cn/record/282345151)|$\text{2026/6/21}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P12890](https://www.luogu.com.cn/problem/P12890)|显然最优方案为逆序对数,为了满足要求,可以反复交换一对数,也就是将次数 +2,分类讨论是显然的。|[AC](https://www.luogu.com.cn/record/282639183)||[P14989](https://www.luogu.com.cn/problem/P14989)|按原规则可以建出 DAG,考虑优化成树。注意到,如果只连两条边只连较小的星球就行了。建反图,LCA,答案即为 LCA 的深度。|[AC](https://www.luogu.com.cn/record/282652862)|$\text{2026/6/22}$:| 题目链接 | 题解 | AC 链接 || :--: | :-: | :---: ||[P14467](https://www.luogu.com.cn/problem/P14467)|分别考虑每个人,倍增求出 $k$ 次后传给谁,直接统计即可。|[AC](https://www.luogu.com.cn/record/282777514)||[P1204](https://www.luogu.com.cn/problem/P1204)|水题。|[AC](https://www.luogu.com.cn/record/282784337)|$\text{2026/6/24}$:| 题目链接 | 题解 | 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)|