版本比较
5.1 ~ 5.31 做题总结
正文
增加 100 行删除 2 行
36 行未改动373839404142434445464736 行未改动写一个 dp 出来,然后线段树维护 $(\min,+)$ 矩乘。### 【1】[ABC456G Count Holidays](https://atcoder.jp/contests/abc456/tasks/abc456_g)`x` 分段,段内独立,考虑 dp 有 $f_i=2f_i-f_{i-k-2}$,写出 OGF 然后展开得到 $f$ 的通项公式,直接算是调和型枚举,复杂度线性对数。赛时没推完式子。### 【1】[P3246 [HNOI2016] 序列](https://www.luogu.com.cn/problem/P3246)单调栈求出 $a_i$ 为最小值的极长区间 $[x_i,y_i]$,注意一个端点取等一个不取。将 $(l,r)$ 刻画到二维平面上,询问即给出一个 2-side 矩形求其中所有 4-side 矩形的权值和,扫描线即可,参见 <https://www.luogu.com.cn/article/dxdsfd1r>。口胡,没写代码。36 行未改动37383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414536 行未改动写一个 dp 出来,然后线段树维护 $(\min,+)$ 矩乘。### 【1】[ABC456G Count Holidays](https://atcoder.jp/contests/abc456/tasks/abc456_g)<https://www.luogu.com.cn/article/8pp570kp>。### 【1】[P3246 [HNOI2016] 序列](https://www.luogu.com.cn/problem/P3246)单调栈求出 $a_i$ 为最小值的极长区间 $[x_i,y_i]$,注意一个端点取等一个不取。将 $(l,r)$ 刻画到二维平面上,那就是先 $n$ 次 4-side 矩形加然后 $q$ 次 2-side 矩形求和,做法参见 <https://www.luogu.com.cn/article/dxdsfd1r>。口胡,没写代码。### 【3】[QOJ9459 Tree Equation](https://qoj.ac/problem/9459)用1exgcd 枚举 $|X|$ 以后维护树哈希,暴力复杂度是对的。### 【2】[QOJ8542 Add One 2](https://qoj.ac/problem/8542)铲雪题。### 【1】[P16414 【MX-X28-T3】「FAOI-R12」寄清梦](https://www.luogu.com.cn/problem/P16414)<https://www.luogu.com.cn/article/lploygux>。### 【2】[P16415 【MX-X28-T4】「FAOI-R12」落花雨](https://www.luogu.com.cn/problem/P16415)<https://www.luogu.com.cn/article/w8w4uuj7>。### 【2】[P10102 [GDKOI2023 提高组] 矩阵](https://www.luogu.com.cn/problem/P10102)随机一个向量 $X$,并检查 $X \times A \times B=X \times C$ 是否成立。### 【2】[P6817 [PA 2013] Filary](https://www.luogu.com.cn/problem/P6817)### 【0】[ARC218A Many Sets](https://atcoder.jp/contests/arc218/tasks/arc218_a)考虑枚举每个**值**算贡献,然后单步容斥得 $m^n-\prod(m-c_{i})$。### 【1】[ARC218B All Minus](https://atcoder.jp/contests/arc218/tasks/arc218_b)<https://www.luogu.com.cn/article/5fd4bssv>。### 【1+】[ARC218C Amidakuji ](https://atcoder.jp/contests/arc218/tasks/arc218_c)<https://www.luogu.com.cn/article/q0d932tz>。### 【0】[P3605 [USACO17JAN] Promotion Counting P](https://www.luogu.com.cn/problem/P3605)自底向上 dfs,需要知道 $p_i$ 的排名,权值树状数组即可。口胡没写代码。### 【1】[ABC366F Maximum Composition](https://www.luogu.com.cn/problem/AT_abc366_f)<https://www.luogu.com.cn/article/pbsgdp0p>。### 【1+】[P7515 [省选联考 2021 A 卷] 矩阵游戏](https://www.luogu.com.cn/problem/P7515)不该不会的,黑白染色和差分约束都想到了,怀疑了半天初始解能不能构造,wssb。<https://www.luogu.com.cn/article/nsswcnh2>。### 【1】[P7514 [省选联考 2021 A/B 卷] 卡牌游戏](https://www.luogu.com.cn/problem/P7514)讨论 $\min, \max$ 是哪个位置以及是否翻,可以二分优化。口胡,但是代码应该挺难写的。### 【1】[P7521 [省选联考 2021 B 卷] 取模](https://www.luogu.com.cn/problem/P7521)枚举 $k$,然后分 $a_i+a_j$ 和 $a_k$ 大小关系讨论,加个最优性剪枝复杂度就是对的了。要敢于写代码,不要空想。### 【2】[CF1270G Subset with Zero Sum](https://www.luogu.com.cn/problem/CF1270G)<https://www.luogu.com.cn/article/9sa8kk5s>。### 【1+】[CF1545B AquaMoon and Chess](https://www.luogu.com.cn/problem/CF1545B)被诈骗了。`11` 的数目和 `0` 的数目算出来以后可以任意放,答案是组合数。### 【1+】[CF1844B Permutations & Primes](https://www.luogu.com.cn/problem/CF1844B)被 *1000 诈骗说是。找降智题做的坏处。2 3 放两边 1 放中间,根本不用管大质数。### 【?】[ARC214D Distinct Sum Grid Path](https://www.luogu.com.cn/problem/AT_arc214_d)### 【2】[P10873 [COTS 2022] 帽子 Šeširi](https://www.luogu.com.cn/problem/P10873)<https://www.luogu.com.cn/article/jhp1w06t>。### 【2】[QOJ14559 并行计算](https://qoj.ac/problem/14559)<https://www.luogu.com.cn/article/7z7gltzo>。### 【1】[CF1325F Ehab's Last Theorem](https://www.luogu.com.cn/problem/CF1325F)<https://www.luogu.com.cn/article/j82vxuoi>。### 【2】[QOJ14945 友谊地久天长](https://qoj.ac/problem/14945/statement/zh_cn)### 【4】[P16433 [APIO 2026 中国赛区] 上升](https://www.luogu.com.cn/problem/P16433)### 【2】[P16434 [APIO 2026 中国赛区] 蛋糕](https://www.luogu.com.cn/problem/P16434)### 【4】[P16435 [APIO 2026 中国赛区] 集宝](https://www.luogu.com.cn/problem/P16434)### 【3】[P8329 [ZJOI2022] 树](https://www.luogu.com.cn/problem/P8329)<https://www.luogu.com.cn/article/rua1slet>。### 【0】[UVA11481 Arrange the Numbers](https://www.luogu.com.cn/problem/UVA11481)<https://www.luogu.com.cn/article/jwhfr3ny>。