<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>LeleBlog</title>
    <link>https://leleprogrammer.github.io/</link>
    <description>Lele 个人博客</description>
    <language>zh-cn</language>
    <atom:link href="https://leleprogrammer.github.io/rss.xml" rel="self" type="application/rss+xml"/>
    <lastBuildDate>Wed, 25 Nov 2026 05:22:06 GMT</lastBuildDate>
    <item>
      <title>容斥原理进阶</title>
      <link>https://leleprogrammer.github.io/posts/inclusion-exclusion-principle-advance/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/inclusion-exclusion-principle-advance/</guid>
      <pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate>
      <description>ChatGPT 推荐的容斥原理进阶文章</description>
      <category>AI 好文推荐</category>
      <category>OI</category>
      <category>容斥原理</category>
      <category>AI 好文推荐</category>
    </item>
    <item>
      <title>NOIP 字符串专题训练</title>
      <link>https://leleprogrammer.github.io/posts/string-training-recommendation/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/string-training-recommendation/</guid>
      <pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate>
      <description>ChatGPT 推荐的 NOIP 字符串专题复习训练</description>
      <category>AI 好文推荐</category>
      <category>OI</category>
      <category>字符串</category>
      <category>AI 好文推荐</category>
    </item>
    <item>
      <title>容斥原理基础</title>
      <link>https://leleprogrammer.github.io/posts/inclusion-exclusion-principle-basis/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/inclusion-exclusion-principle-basis/</guid>
      <pubDate>Tue, 24 Nov 2026 00:00:00 GMT</pubDate>
      <description>ChatGPT 总结的容斥原理基础</description>
      <category>AI 好文推荐</category>
      <category>OI</category>
      <category>容斥原理</category>
      <category>AI 好文推荐</category>
    </item>
    <item>
      <title>CSP-S 2026 T3 题解</title>
      <link>https://leleprogrammer.github.io/posts/csps-2026-t3-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/csps-2026-t3-solution/</guid>
      <pubDate>Sat, 31 Oct 2026 00:00:00 GMT</pubDate>
      <description>详细讲解 dp 做法，有配图，更易理解。 思路 用 表示点 向右走不超过 的距离，可达的最右边的一个位置， 则表示点 向左走不超过 的距离，可达的最左边的一个位置，这个可以用双指针扫两次求得。 钦定 ，从 走到 ，一种最短路径很显然是每次走到 ，直至到达终点。不难发现这种移动方式…</description>
      <category>OI</category>
      <category>题解</category>
      <category>OI</category>
      <category>CSP</category>
    </item>
    <item>
      <title>题解：P16483 [GKS 2014 #B] New Years Eve</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16483-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16483-solution/</guid>
      <pubDate>Tue, 11 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 一层，形如： 1 2 3 4 5 6 7 8 9 10 ... 每个杯子会流向下方的三个杯子，第 个杯子正下方偏上的一个是 ，偏左下的一个分别为： 2 4 5 7 8 9 11 12 13 14 ... 同一层（高度）内，我们还可以分成若干小层，每一个小层的杯子数量分别为…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>Google Kick Start</category>
    </item>
    <item>
      <title>题解：P16508 [GKS 2015 #B] gNumbers</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16508-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16508-solution/</guid>
      <pubDate>Tue, 11 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 最小的 个质数乘起来已经超过 ，即 的质因子很少，可以状压。 我们用 表示取到状态 时必胜还是必败，具体地， 是一个长度不超过 的二进制数，位为 则表示当前存在该位对应的质因子。 如果一个数是 gNumber，那么 ，必败。 对于其余的数字，如果进行任何一种操作后均得到 ，…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>Google Kick Start</category>
      <category>状态压缩</category>
      <category>DP</category>
    </item>
    <item>
      <title>题解：CF2253C Sum of Distinct Values in a Matrix</title>
      <link>https://leleprogrammer.github.io/posts/cf-2253c-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2253c-solution/</guid>
      <pubDate>Mon, 10 Aug 2026 00:00:00 GMT</pubDate>
      <description>这题思路很容易想到，但是实现方式需要琢磨琢磨，赛时卡了一段时间。 思路 假设现在我们在某一行填了一个数字，那么这个数字会出现 次，又因为重复的数字只算一次，那么我们可以选定 个列进行填数。行列转换一下也是同理。 将行和列出现的那些数字放在一起排序，并标明每个数字属于行还是列，然后…</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：CF2253D Hypercarp and Interdimensional Jumps</title>
      <link>https://leleprogrammer.github.io/posts/cf-2253d-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2253d-solution/</guid>
      <pubDate>Mon, 10 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 每一次跳动都会让某个分量的速度 ，而这个速度会对后续的跳动产生影响。 那么我们考虑，一次操作造成的速度 会导致最终路程发生什么变化。 很显然，若总共操作 次，那么第 次操作会对坐标分量贡献 的路程，第 次操作贡献 的路程，依此类推。 那么我们枚举 表示总共操作 次，然后对于…</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：CF2253E Diameter Intersections</title>
      <link>https://leleprogrammer.github.io/posts/cf-2253e-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2253e-solution/</guid>
      <pubDate>Mon, 10 Aug 2026 00:00:00 GMT</pubDate>
      <description>比赛最后 秒过的。 思路 结论：选定一条直径 ，其余的所有直径 都会与 相交，且边的交集一定包含最中间的那条边。 证明如下： 首先题目保证树的直径经过的边数为奇数，那么存在“最中间的边”。 接下来考虑反证法，若存在一条直径 与 的交不为最中间的边，那么我们选择其点集的交的其中一个…</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：P16481 [GKS 2014 #A] Addition</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16481-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16481-solution/</guid>
      <pubDate>Mon, 10 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 把每个变量看成是节点，给出的等式关系看成是边，比如 ，我们就在点 和点 之间连接一条权值为 的双向边。 对于一个节点，我们用 表示它的值，其中 是已知常数。 对于一个连通块，我们随便选一个节点，设其为 ，然后根据等式关系，只需要拿边权减去该点的值就可以得到另一点的值，因此我…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>Google Kick Start</category>
      <category>图论</category>
      <category>图论建模</category>
    </item>
    <item>
      <title>题解：P16480 [GKS 2014 #A] Cut Tiles</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16480-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16480-solution/</guid>
      <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 考虑如何切割 的瓷砖，使其浪费最少。 由于切出来的都是正方形瓷砖，那么我们可以只看其中一条边。 把 拆分成 的若干次方的和，并且每次尽可能让这个 的次方数更大，这样拆分是最优的。证明如下：大块的可以拆成小块的，如 可以拆分成两个 ，那么平方一下就是四块，但小块的不一定可以拼…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>数学</category>
      <category>Google Kick Start</category>
    </item>
    <item>
      <title>题解：CF2254C1 Marenol (easy version)</title>
      <link>https://leleprogrammer.github.io/posts/cf-2254c1-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2254c1-solution/</guid>
      <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 不难发现操作等价于选定 然后交换 和 。 那么下标为奇数的数就只能在奇数下标移动，偶数同理，那么记 为 ， 为 ， 同理，然后分别排序。最后判断 是否成立即可。</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：CF2254C2 Marenol (hard version)</title>
      <link>https://leleprogrammer.github.io/posts/cf-2254c2-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2254c2-solution/</guid>
      <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 操作等价于选择一个位置 然后交换 。 那么对于奇偶下标分开处理即可。 比如对于奇数下标， ，分别找出所有值为 的下标，下标升序排序分别记为 。 有解，答案就是 ，也就是把 的每一个位置通过 移动到和 相同所需的代价。 举个例子： ，那么有 ，那么答案就是 。</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：CF2254E Chronostasis</title>
      <link>https://leleprogrammer.github.io/posts/cf-2254e-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2254e-solution/</guid>
      <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 题意简述：给定一个差分数组，我们可以任意重排这个数组，使得原序列都是正整数且字典序最小。 初始 ，每次我们找到 的最小整数 填入新的位置，然后 ，用 multiset 维护即可。 如果按照上述方法不能填满整个序列，则无解。</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：CF2254F Whiplash</title>
      <link>https://leleprogrammer.github.io/posts/cf-2254f-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/cf-2254f-solution/</guid>
      <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 是偶数，这是一个重要的条件。 假设初始序列是 ，我们先对 操作，设 ，则序列变为： 然后对 操作，不妨设 ，且 ，则： 化简得： 然后再对 操作，可得： 不难发现， 的操作等价于交换 的位置，所以如果给定序列 在排序后相同，则可行。 那如果不相同呢？这里用到了 是偶数的限制…</description>
      <category>OI</category>
      <category>题解</category>
      <category>Codeforces</category>
      <category>OI</category>
    </item>
    <item>
      <title>题解：P16476 [GKS 2013 #B] Meet and party</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16476-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16476-solution/</guid>
      <pubDate>Thu, 06 Aug 2026 00:00:00 GMT</pubDate>
      <description>思路 曼哈顿距离，可以把 的距离和 的距离分开算。 那么我们只要对 坐标和 坐标分别离散化，然后考虑以下子问题：给定多个 ，求出 ，推式子，为了防止式子太复杂，我们这里以 为例子，去掉绝对值，变成 ，显然括号中的 可以提出来，变成 ，其中 为 的 个数， 为 的 个数，显然这四项…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>离散化</category>
      <category>前缀和</category>
      <category>Google Kick Start</category>
    </item>
    <item>
      <title>题解：洛谷 P6041 「ACOI2020」布丁暗杀计划</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p6041-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p6041-solution/</guid>
      <pubDate>Wed, 06 May 2026 00:00:00 GMT</pubDate>
      <description>思路 离线处理询问，使用倍增，求出询问的 级祖先，于是问题就变成了，给定 和 ，求 的子树中，到树根深度为 的节点颜色与 相同的那些点的 之和。这部分复杂度是 。 每个颜色都是独立开的，所以把每种颜色分开来，重新建立一个森林，每一棵树对应一个颜色，其中父子节点的相对顺序与原图一致…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>启发式合并</category>
    </item>
    <item>
      <title>题解：洛谷 P16305 [蓝桥杯 2026 省 Java C 组] 奇偶交换</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16305-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16305-solution/</guid>
      <pubDate>Tue, 14 Apr 2026 00:00:00 GMT</pubDate>
      <description>思路 我们把偶数视为 ，奇数视为 ，则只有 与 可以交换位置，即 可以自由左右移动直到遇到另一个 为止，也就是说 可以在保证相对顺序不变的情况下随意放置，所以答案就是 ，其中 是奇数数量。</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>蓝桥杯</category>
    </item>
    <item>
      <title>题解：洛谷 P16273 [蓝桥杯 2026 省 Java B 组] 回程</title>
      <link>https://leleprogrammer.github.io/posts/luogu-p16273-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/luogu-p16273-solution/</guid>
      <pubDate>Sun, 12 Apr 2026 00:00:00 GMT</pubDate>
      <description>简单图论题。 思路 分层图，共 层，第 层表示还未经过特殊点，第 层表示经过了特殊点并且使用了 次机会，第 层表示使用了 次，依此类推。 用 表示第 层图的第 个点，那么对于输入的 ，我们可以按如下方式连边： ，边权为 ，且 。 ，边权为 ，且 。 对于给定的 ，连边： ，边权为…</description>
      <category>OI</category>
      <category>题解</category>
      <category>洛谷</category>
      <category>OI</category>
      <category>蓝桥杯</category>
      <category>图论</category>
    </item>
    <item>
      <title>题解：AT_abc452_e [ABC452E] You WILL Like Sigma Problem</title>
      <link>https://leleprogrammer.github.io/posts/atcoder-abc452e-solution/</link>
      <guid isPermaLink="true">https://leleprogrammer.github.io/posts/atcoder-abc452e-solution/</guid>
      <pubDate>Tue, 07 Apr 2026 00:00:00 GMT</pubDate>
      <description>思路 求 的值。 不妨变换一下求和顺序： 。 假设现在 是确定的，那么 的 的贡献是可以求的。比如说 ，那么 的 贡献次数依次是 ，那么我们只要维护 的前缀和以及 ，就可以快速求得每一个形如 的区间答案。 当 时，每次能覆盖的区间长度就是 ，因此对于每个 ， 都直接扫一遍，复杂度…</description>
      <category>OI</category>
      <category>题解</category>
      <category>AtCoder</category>
      <category>OI</category>
    </item>
  </channel>
</rss>
