<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[zppbugmaker的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/zppbugmaker</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; zppbugmaker]]></copyright><item><title><![CDATA[牛客练习赛101]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/125470460</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/125470460</guid><author>zppbugmaker</author><pubDate>Sun, 26 Jun 2022 16:09:32 +0800</pubDate><description><![CDATA[牛客练习赛101]]></description><category></category></item><item><title><![CDATA[HUSTPC2022]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/125220572</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/125220572</guid><author>zppbugmaker</author><pubDate>Fri, 10 Jun 2022 14:41:26 +0800</pubDate><description><![CDATA[HUSTPC2022]]></description><category></category></item><item><title><![CDATA[AtCoder Beginner Contest 254]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/125149008</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/125149008</guid><author>zppbugmaker</author><pubDate>Mon, 06 Jun 2022 16:26:54 +0800</pubDate><description><![CDATA[AtCoder Beginner Contest 254]]></description><category></category></item><item><title><![CDATA[CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/125119903</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/125119903</guid><author>zppbugmaker</author><pubDate>Sat, 04 Jun 2022 11:33:17 +0800</pubDate><description><![CDATA[CodeCraft-22 and Codeforces Round #795 (Div. 2)]]></description><category></category></item><item><title><![CDATA[第十七届黑龙江省大学生程序设计竞赛]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124853048</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124853048</guid><author>zppbugmaker</author><pubDate>Wed, 18 May 2022 23:40:47 +0800</pubDate><description><![CDATA[文章目录C.Tree DivisionD.Collision DetectorG.Chevonne's Necklace
比赛链接
C.Tree Division
题意：
有一颗n(1≤n≤105)n(1\leq n\leq10^5)n(1≤n≤105)个节点的树，树上每个位置都有一个值aia_iai​，将树上的节点分入A,BA,BA,B两个集合，要求以111为根节点的树，能否使集合AAA在树链上递增，集合BBB在树链上递减。
思路：
考虑如果在单个直线数组上进行这个问题怎么办。
如果我们可以在每次将一个数]]></description><category></category></item><item><title><![CDATA[POJ - 2396 Budget（上下界网络流）]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124841623</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124841623</guid><author>zppbugmaker</author><pubDate>Wed, 18 May 2022 14:32:21 +0800</pubDate><description><![CDATA[Budget 题目链接
题意：
有n∗mn*mn∗m的数字矩阵，告诉你每行和每列的数字之和，接下来有ccc行约束条件，第ccc行会告诉你第iii行第jjj列的格子应该有怎样的约束(&gt;,&lt;,=)(&gt;,&lt;,=)(&gt;,&lt;,=)，请输出任一种满足所有约束的矩阵或者输出不可能
思路：
经典的建图模型：
将每行每列都抽象为111个点，源点与行相连，汇点与列相连，流量上下界均为suml/sumcsum_l/sum_csuml​/sumc​
每行每列直接的连线流量代表这些位置的约束范围
]]></description><category></category></item><item><title><![CDATA[2021 Xinjiang Provincial Collegiate Programming Contest(A,B)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124786412</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124786412</guid><author>zppbugmaker</author><pubDate>Sun, 15 May 2022 19:39:39 +0800</pubDate><description><![CDATA[文章目录B. cocktail with hearthstone
写在最前面，单纯的想吐槽一下这场的题面读起来是真的绕
B. cocktail with hearthstone
题意：
一个计数器(a,b)(a,b)(a,b)记录的是进行了a+ba+ba+b局游戏，胜了aaa场，负了bbb场，每次游戏开始会匹配两个胜负场次完全相同的玩家游戏，玩家数量2n+m(1≤m&lt;n≤2×105)2^{n+m}(1≤m&lt;n≤2×10^5)2n+m(1≤m&lt;n≤2×105)，当有一个玩家在赢了nnn场或输]]></description><category></category></item><item><title><![CDATA[Codeforces Round #789 (Div. 2) F]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124742311</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124742311</guid><author>zppbugmaker</author><pubDate>Thu, 12 May 2022 23:45:00 +0800</pubDate><description><![CDATA[文章目录F. Tokitsukaze and Permutations
F. Tokitsukaze and Permutations
题意：
给你长度为n(n≤106)n(n\leq10^6)n(n≤106)的排列，可以进行k(k&lt;n)k(k&lt;n)k(k&lt;n)次操作，每次操作从111遍历到nnn，如果ai&gt;ai+1a_i&gt;a_{i+1}ai​&gt;ai+1​，则交换两个数字。
给你数组v(vi&lt;i)v(v_i&lt;i)v(vi​&lt;i)，viv_ivi​表示a1]]></description><category></category></item><item><title><![CDATA[Codeforces Round #787 (Div. 3)F(糖果传递)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124649724</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124649724</guid><author>zppbugmaker</author><pubDate>Sun, 08 May 2022 16:45:54 +0800</pubDate><description><![CDATA[文章目录F.Sorting Pancakes
F.Sorting Pancakes
题意：
给你n(n≤250)n(n\leq 250)n(n≤250)个整数的序列a(∑ai≤250)a(\sum a_i\leq250)a(∑ai​≤250)，你可以用111的花费将ai−1a_i-1ai​−1，使ai+1a_{i+1}ai+1​或ai−1&nbsp;+1a_{i-1}\text{ }+1ai−1​&nbsp;+1，问最小用多少的花费可将序列变为不上升序列
思路：
由于本题数据范围极小，于是想到费用流，但是由]]></description><category></category></item><item><title><![CDATA[Codeforces Round #786 (Div. 3)(E,G)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124583437</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124583437</guid><author>zppbugmaker</author><pubDate>Thu, 05 May 2022 10:50:38 +0800</pubDate><description><![CDATA[文章目录E. Breaking the WallG. Remove Directed Edges
E. Breaking the Wall
题意：
有nnn面连续的城墙，其都有自己的耐久aia_iai​，你的大炮可以攻击墙iii，使ai−2,ai−1−1,ai+1−1a_i-2,a_{i-1}-1,a_{i+1}-1ai​−2,ai−1​−1,ai+1​−1，请问最少攻击多少次能最少破坏两堵墙
思路：
一共三种情况：
（1）破坏两面距离超过222的墙x,yx,yx,y，只要⌈x2⌉+⌈y2⌉\left\lc]]></description><category></category></item><item><title><![CDATA[Codeforces Round #785 (Div. 2)(D,F)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124569655</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124569655</guid><author>zppbugmaker</author><pubDate>Wed, 04 May 2022 14:49:50 +0800</pubDate><description><![CDATA[文章目录D. Lost Arithmetic ProgressionF. Anti-Theft Road Planning
D. Lost Arithmetic Progression
题意：
三个数组A,B,CA,B,CA,B,C为等差数列，其中C=A⋂BC=A \bigcap BC=A⋂B
给你B,CB,CB,C的首项，差值，长度，问符合题意的AAA有多少种构成方式，或者判断是否无解或者无限解
思路：

显然dc=LCM(da,db)d_c=LCM(d_a,d_b)dc​=LCM(da​,db​)
首先]]></description><category></category></item><item><title><![CDATA[Codeforces Global Round 20(F,H)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124439427</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124439427</guid><author>zppbugmaker</author><pubDate>Wed, 27 Apr 2022 23:33:25 +0800</pubDate><description><![CDATA[文章目录F1. Array Shuffling
F1. Array Shuffling
题意：
给你长度为nnn的数组aaa，请你用aaa的排列构造出一个新的数组bbb，你可以任意交换数组bbb上的任意两个元素，要求用数组bbb通过交换，复原数组aaa所需要的次数最多，构造出这个bbb
思路：
一个结论：如果bib_ibi​可以移动到bjb_jbj​的位置，则可以将点i∼ji \sim ji∼j连一条边，连好边后可以得到cntcntcnt个环，最终的操作数为n−cntn-cntn−cnt
那么，只要我们有最]]></description><category></category></item><item><title><![CDATA[The 15th Jilin Provincial Collegiate Programming Contest]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124461284</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124461284</guid><author>zppbugmaker</author><pubDate>Wed, 27 Apr 2022 21:50:25 +0800</pubDate><description><![CDATA[文章目录F. CookingG. Matrix Repair
F. Cooking
题意：
给定若干010101串，求它们的最长公共前后缀长度之和。
思路：
多模式串匹配，首先考虑ACACAC自动机
如果我们不考虑最长的限制，只需要对所有的字符串从结尾开始跳failfailfail，跳到的点一定是一个公共前后缀。于是我们每跳到一个点会产生贡献si∗lenis_i*len_isi​∗leni​，其中sis_isi​是节点iii出现的次数，lenilen_ileni​是这个位置代表的子串长度，最终答案就是∑si]]></description><category></category></item><item><title><![CDATA[AtCoder Beginner Contest 249(E)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124413291</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124413291</guid><author>zppbugmaker</author><pubDate>Mon, 25 Apr 2022 20:27:47 +0800</pubDate><description><![CDATA[E - RLE
题意：
有一种字符串转换方式，例如
“aaabbcccc”“aaabbcccc”“aaabbcccc”可以转换为“a3b2c4”“a3b2c4”“a3b2c4”
求长度为nnn的字符串，有多少种不同的字符串可以使转换后的字符串长度小于nnn
思路：
动态规划
令f[i][j]f[i][j]f[i][j]为长度为iii的字符串，转换后的长度为jjj，有多少种情况
cal(x)cal(x)cal(x)表示连续xxx个相同的字母组成的字符串转换成新串后的长度
最最简单的dpdpdp转移办法即
f[]]></description><category></category></item><item><title><![CDATA[Educational Codeforces Round 127（D~E）]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124382591</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124382591</guid><author>zppbugmaker</author><pubDate>Sun, 24 Apr 2022 15:09:52 +0800</pubDate><description><![CDATA[文章目录D. Insert a ProgressionE. Preorder
D. Insert a Progression
题意：
给你长度为nnn的数组aaa以及一个数字xxx，要求你将1∼x1\sim x1∼x的所有xxx个数字随意插入数组aaa中，要求插入完毕后新获得的数组aaa的∑i=1n+x−1∣ai−ai+1∣\sum _{i=1} ^{n+x-1}|a_i-a{i+1}|∑i=1n+x−1​∣ai​−ai+1∣值尽可能的小，输出这个值
思路：
在nnn个数字中最大的数字为maxmaxmax，]]></description><category></category></item><item><title><![CDATA[Codeforces Round #783 (Div. 2)(D~F)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124317519</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124317519</guid><author>zppbugmaker</author><pubDate>Thu, 21 Apr 2022 12:11:44 +0800</pubDate><description><![CDATA[文章目录D. Optimal PartitionE. Half Queen CoverF. Edge Elimination
D. Optimal Partition
题意：
给你长度为nnn的数组aaa，将其划分为任意数量的连续子串，一个子串l∼rl \sim rl∼r的价值为
sign(∑i=lrai)∗(r−l+1)sign(\sum_{i = l}^{r}a_i)*(r-l+1)sign(∑i=lr​ai​)∗(r−l+1)
问可以划分出来的子串价值之和最大是多少
思路：
考虑dpdpdp,定义dp]]></description><category></category></item><item><title><![CDATA[Codeforces Round #782 (Div. 2)]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124289892</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124289892</guid><author>zppbugmaker</author><pubDate>Wed, 20 Apr 2022 10:57:45 +0800</pubDate><description><![CDATA[文章目录A. Red Versus BlueB. Bit FlippingC. Line EmpireD. Reverse Sort SumE. AND-MEX Walk
A. Red Versus Blue
题意：
红队和蓝队比赛，红队赢rrr局，蓝队赢bbb局(r&gt;b)(r&gt;b)(r&gt;b)，由于比赛过程势均力敌，请你构造出合适的字符串使红队的最长连胜最小
思路：
考虑在蓝队的bbb局共b+1b+1b+1个空位均值插入rrr即可
#include&lt;bits/stdc++.h&gt;]]></description><category></category></item><item><title><![CDATA[2020ICPC昆明题解]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/124187379</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/124187379</guid><author>zppbugmaker</author><pubDate>Fri, 15 Apr 2022 10:00:17 +0800</pubDate><description><![CDATA[最近VP了2021年的昆明区域赛，补几道题并总结一下教训

文章目录前言C.	CitiesM.Stone Games
前言

本次总共写出来四题，其中HHH题大水题一个，III题是计算几何二维平面中的板子题而且以前写过，所以在还算比较快的时间开出来了，JJJ题强行当了一把ddlddlddl战神，样例都没测就交了，LLL题连结论都没有好好推出来，就让sglysglysgly上机写了个树状数组，稀里糊涂的过了

C.	Cities
对于一个长度为mmm且没有相同元素的区间，需要操作m−1m-1m−1次才可维护.]]></description><category></category></item><item><title><![CDATA[强连通分量（tarjan）割点]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/120467889</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/120467889</guid><author>zppbugmaker</author><pubDate>Sat, 25 Sep 2021 10:00:13 +0800</pubDate><description><![CDATA[有向图强连通分量：在有向图G中，如果两个顶点vi,vj间（vi&gt;vj）有一条从vi到vj的有向路径，同时还有一条从vj到vi的有向路径，则称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通，称G是一个强连通图。有向图的极大强连通子图，称为强连通分量(strongly connected components)。——百度百科

可以将tarjan想象为有向图中，图中各点互相可以联通的一种高级查并集。
通过tarjan可以将带有环的图缩减为无环图，从而简化题目的判断]]></description><category></category></item><item><title><![CDATA[基础 莫队]]></title><link>https://blog.youkuaiyun.com/zppbugmaker/article/details/120374144</link><guid>https://blog.youkuaiyun.com/zppbugmaker/article/details/120374144</guid><author>zppbugmaker</author><pubDate>Sat, 18 Sep 2021 21:33:56 +0800</pubDate><description><![CDATA[HH的项链
n个数字，对其进行q次询问，每次一个l和r，输出l到r区间内不同元素的个数
莫队解法：
考虑使用双指针遍历这n个数字，通过移动指针来删减区间内元素的数目，从而不断更新答案。
那么对于多次的查询，莫队的关键就在于使用排序，使排序过后的查询能够移动指针最少次数，达到想要的效果，这样后一次查询就可以建立在上一次移动的基础上，减少了运算次数
排序方法：对于右指针，对其进行数字下标的单调排列。对于左指针，对其进行分块处理，按照分块的序号进行排序，这样就缩减了两条指针的移动距离。
#include&lt;b]]></description><category></category></item></channel></rss>