<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[weixin_45931113的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/weixin_45931113</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; weixin_45931113]]></copyright><item><title><![CDATA[正则表达式匹配]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/121132884</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/121132884</guid><author>weixin_45931113</author><pubDate>Wed, 03 Nov 2021 23:13:56 +0800</pubDate><description><![CDATA[正则表达式匹配 给你一个字符串 s 和一个字符规律 p，请你来实现一个支持 ‘.’ 和 ‘*’ 的正则表达式匹配。

‘.’ 匹配任意单个字符 ‘*’ 匹配零个或多个前面的那一个元素 所谓匹配，是要涵盖 整个 字符串 s的，而不是部分字符串。

dp[i][j] i,j分别代表s[i-1] p[j-1],表式两个前缀是否匹配 
当 p[j-1]=='*' 时dp[i][j]=dp[i][j-2](取消*匹配)|dp[i-1][j] s去掉字符串尾部再进行*匹配
p[j-1]!=*
dp[i][j]=dp..]]></description><category></category></item><item><title><![CDATA[寻找两个正序数组的中位数]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/121024745</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/121024745</guid><author>weixin_45931113</author><pubDate>Thu, 28 Oct 2021 22:27:39 +0800</pubDate><description><![CDATA[给定两个大小分别为 m 和 n 的正序（从小到大）数组 nums1 和 nums2。请你找出并返回这两个正序数组的 中位数 。
归并排序时间复杂度O(n+m)
class Solution {
public:
    double findMedianSortedArrays(vector&lt;int&gt;&amp; nums1, vector&lt;int&gt;&amp; nums2) {
            int pre=-0x3f3f3f3f,now=-0x3f3f3f3f;
      ]]></description><category></category></item><item><title><![CDATA[Gardener and Tree]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/120857619</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/120857619</guid><author>weixin_45931113</author><pubDate>Wed, 20 Oct 2021 13:09:28 +0800</pubDate><description><![CDATA[A tree is an undirected connected graph in which there are no cycles. This problem is about non-rooted trees. A leaf of a tree is a vertex that is connected to at most one vertex.
The gardener Vitaly grew a tree from n vertices. He decided to trim the tree]]></description><category></category></item><item><title><![CDATA[The Number of Imposters]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/120678923</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/120678923</guid><author>weixin_45931113</author><pubDate>Sat, 09 Oct 2021 20:58:48 +0800</pubDate><description><![CDATA[D. The Number of Imposters time limit per test3 seconds memory limit
per test256 megabytes inputstandard input outputstandard output
Theofanis started playing the new online game called “Among them”.
However, he always plays with Cypriot players, and they.]]></description><category></category></item><item><title><![CDATA[D. Lowbit]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/120104519</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/120104519</guid><author>weixin_45931113</author><pubDate>Sat, 04 Sep 2021 19:34:32 +0800</pubDate><description><![CDATA[Lucida has a sequence of n integers a1,a2,…,an
. He asks you to perform two types of operations for him, which are
described as follows:

1 L R, add lowbit(ai) to each ai in the interval [L,R]

.

2 L R, query the sum of the numbers in the interval [L,R]
.]]></description><category></category></item><item><title><![CDATA[2021-06-07]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/119334041</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/119334041</guid><author>weixin_45931113</author><pubDate>Mon, 02 Aug 2021 22:39:05 +0800</pubDate><description><![CDATA[放假之前报了牛客的多校，放假之后做了几场牛客多校不理想。
时间过得比较快，重新组队后,我们开始打hdu多校，联系了一些常用的数据结构的题目，我还是负责数据结构和dp,考虑到现在的水平，做题的重心放在了铜牌题上。做hdu多校,尽量理解思考。不会则去看题解理解。
下月主要做一些vj思维题题目和在洛谷上解决一些数据结构的题目,hdu多校题目比较困难，继续加油吧。

...]]></description><category></category></item><item><title><![CDATA[E.String reversal]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/117637272</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/117637272</guid><author>weixin_45931113</author><pubDate>Mon, 07 Jun 2021 00:05:38 +0800</pubDate><description><![CDATA[题意：
将一个字符串通过交换相邻的字符变为反转的字符串的最小次数。
将反转后的字符串每个字符视为离原字符串最近的字符转移的。
从后向前遍历，如果一个字符在已经进入树状字符的后面则必定于其交换一次，用树状数组维护。

#include &lt;iostream&gt;
#include &lt;algorithm&gt;
#include &lt;cstdio&gt;
#include &lt;queue&gt;
#include &lt;cstring&gt;
#include &lt;vector&g..]]></description><category></category></item><item><title><![CDATA[省赛总结]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/116600467</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/116600467</guid><author>weixin_45931113</author><pubDate>Mon, 10 May 2021 18:02:16 +0800</pubDate><description><![CDATA[这场省赛我们打的很不好，刚开始我们先捡的题目短的做，很快队友就发现了签到题然后就把签到题AC了，另一道题意思我没读懂暂时不明白就跳过了，然后分头找题，我发现一个01背包问题，但是很久没做背包题目了出了差错，跟队友讨论后成功从WR到MemoryLimited了，然后很快想到了滚动数组，但是出了差错改错了，最后耗费了很长时间Wr了好几次才AC。然后我们跟榜做M题，队友发现是构造类型的题目，但是发现没有啥思路也WR了好几次最后放弃了，最后lcy根据做题情况让我们做c,d题，明显d题比较简单但是也是想了很长时间外加]]></description><category></category></item><item><title><![CDATA[五一总结]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/116431127</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/116431127</guid><author>weixin_45931113</author><pubDate>Thu, 06 May 2021 00:22:23 +0800</pubDate><description><![CDATA[这一个五一假期，我参与了五一训练不久之后就是省赛感觉自己的水平不够，在这几场比赛中，队友比较给力，我感觉我比较拖后腿了，尤其是代码水平的下滑，让我出现了许多次的错误提交，做题进度上也落后了。除了简单题外，能做出的比较难的题目甚少。最近想题目耗费的时间比较多，这次训练的J题我们想了2个小时一直没有想出来，一直在推公式，这一题实际上是找规律，在这方面我比较缺乏思路的转换。还有时间复杂度估计的不好，容易超时。我在数据结构方面也处理的不好。做题思路上我没有大体的规划因为我比较菜，基本上在跟榜。现在的步骤就是整理数据]]></description><category></category></item><item><title><![CDATA[leeing Sunlight(二分)]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/116178924</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/116178924</guid><author>weixin_45931113</author><pubDate>Tue, 27 Apr 2021 01:05:33 +0800</pubDate><description><![CDATA[Klee's definition of playing is throwing explosives all over the place; she is particularly fond of "fish blasting'' --- throwing bombs in lakes full of fish.  Today, Klee also plans to blast fish in Starfell Lake. There are n fish in Starfell Lake. Klee .]]></description><category></category></item><item><title><![CDATA[venile Galant(简单dp+逆元)]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/116177394</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/116177394</guid><author>weixin_45931113</author><pubDate>Mon, 26 Apr 2021 23:58:21 +0800</pubDate><description><![CDATA[时间限制：C/C++ 1秒，其他语言2秒
空间限制：C/C++ 524288K，其他语言1048576K
 64bit IO Format: %lld


题目描述




As a self-proclaimed practitioner of the Guhua Clan (Aka. Kokaha)'s arts, Xingqiu (Aka.&nbsp;Yukuaki) is planning to forge a longsword with length n. The following p...]]></description><category></category></item><item><title><![CDATA[周训练总结]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/116142791</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/116142791</guid><author>weixin_45931113</author><pubDate>Mon, 26 Apr 2021 09:11:35 +0800</pubDate><description><![CDATA[这一周,我们队打了四场比赛，比赛的效果并不好，周末的联盟赛让我清楚了我现在的水平不够，这几场比赛有两场遇到了差不多的数据结构题目类型，但是没能及时做出总是有偏差，这是我的失误，还有一些dp类型的题目，感觉做题还是少了没有快速看出题目的用意，这周做题疏忽了，下周要加紧补充题目。

...]]></description><category></category></item><item><title><![CDATA[P2198 杀蚂蚁]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115471541</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115471541</guid><author>weixin_45931113</author><pubDate>Tue, 06 Apr 2021 21:32:23 +0800</pubDate><description><![CDATA[1.放射塔和辐射塔都是经过后才起作用，所以最后那位一定是激光塔。
2.因为放射塔和辐射塔的效果可以累加所以激光塔最后放最优。
3.枚举激光塔的长度，剩下的区间放置辐射塔和放射塔
int n,r,g,b,t; 激光塔  辐射塔 放射塔
dp[i][j] i为放射塔数量,j为辐射塔的数量
动态转移方程dp[i][j]=max(dp[i-1][j]+(n-i-j)(j * g)b,dp[i][j-1]+(n-i-j)(ib+t)*g);
__int128挺好用

#include&lt;iostream&gt..]]></description><category></category></item><item><title><![CDATA[杠杆数]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115470324</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115470324</guid><author>weixin_45931113</author><pubDate>Tue, 06 Apr 2021 20:41:04 +0800</pubDate><description><![CDATA[…
#include&lt;iostream&gt;
#include&lt;cstring&gt;
using namespace std;
#define ll long long
const int maxn=25;
ll pos[maxn];
ll dp[maxn][maxn][maxn*100];
ll i;
ll dfs(int ps,int pt,int st,int fn)//数的位数 支点的位置  力矩和
{
    if(!ps)
        return st==0;
    i.]]></description><category></category></item><item><title><![CDATA[Philosopher‘s Walk(分治)]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115313843</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115313843</guid><author>weixin_45931113</author><pubDate>Mon, 29 Mar 2021 22:54:33 +0800</pubDate><description><![CDATA[Philosopher‘s Walk
画几遍图，你会发现有四种形态而且相互转化。
#include&lt;iostream&gt;
#include&lt;cstdio&gt;
using namespace std;
int block[4][4]={{1,0,0,3},{2,1,1,0},{3,2,2,1},{0,3,3,2}};
int rectu[4][4]={{0,1,2,3},{1,2,3,0},{2,3,0,1},{3,0,1,2}};
bool sx=true;
int init=0;
v.]]></description><category></category></item><item><title><![CDATA[P1285 队员分组(二分图+背包)]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115275105</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115275105</guid><author>weixin_45931113</author><pubDate>Sun, 28 Mar 2021 01:36:52 +0800</pubDate><description><![CDATA[P1285 队员分组

#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;complex&gt;
#include &lt;vector&gt;
#include &lt;stack&gt;
#include &lt;cstdio&gt;
#include&lt;functional&gt;
#include&lt;cmath&gt;
#include&lt;ctime&gt;
#include&lt;cstring&gt;
#in]]></description><category></category></item><item><title><![CDATA[CF865C Gotta Go Fast]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115273354</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115273354</guid><author>weixin_45931113</author><pubDate>Sat, 27 Mar 2021 23:19:15 +0800</pubDate><description><![CDATA[CF865C Gotta Go Fast
f[i][j]表示在进行关卡i时的时间。
1.在关卡i前重新开始，期望值为mid
2.关卡i最快方式通过，时间为(dp[i+1][j+a[i]]+a[i])p[i]/100
3.关卡i最慢方式通过，时间为(dp[i+1][j+b[i]+b[i]])(1-p[i]/100)
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;complex&gt;
#include&lt;functional.]]></description><category></category></item><item><title><![CDATA[CF321E Ciel and Gondolas（决策单调性）]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115172283</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115172283</guid><author>weixin_45931113</author><pubDate>Wed, 24 Mar 2021 12:57:54 +0800</pubDate><description><![CDATA[Ciel and Gondolas
动态规划方程是dp[i][j]=min{dp[i-1][j]+cal(k+1,j)},cal(i,j)=cal(i-1,j)+cal(i,j-1)-cal(i-1,i-1)+ch[j][j]。做题时，没有注意策略点的范围，超时了好几次。
#include&lt;cstdio&gt;
#include&lt;cstring&gt;
#include&lt;iostream&gt;
#include&lt;fstream&gt;
using namespace std;
c.]]></description><category></category></item><item><title><![CDATA[CF868F Yet Another Minimization Problem(决策单调性)]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/115048149</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/115048149</guid><author>weixin_45931113</author><pubDate>Sun, 21 Mar 2021 13:22:24 +0800</pubDate><description><![CDATA[Yet Another Minimization Problem
题意：将序列划分为k段，每段的代价为这段所有重复数n(n-1)/2的和，求怎么分段使得，所有段的代价之和最小。
思路:容易知道动态规划方程式为dp[i][j]=max(dp[i-1][k]+cal(k+1,j)){i为分段数,j为序列总长度}但是这样做时间复杂度为O(n3)，所以要对动态规划进行优化。决策单调性若序列总长度分别为i,m,i&gt;m则最优决策点iu&gt;=mu,根据决策点单调的性质分治优化，cal(i,j)则用莫队。
#..]]></description><category></category></item><item><title><![CDATA[Early Orders]]></title><link>https://blog.youkuaiyun.com/weixin_45931113/article/details/114810807</link><guid>https://blog.youkuaiyun.com/weixin_45931113/article/details/114810807</guid><author>weixin_45931113</author><pubDate>Mon, 15 Mar 2021 00:09:54 +0800</pubDate><description><![CDATA[题意:给出一段数字序列，找出序列中字典序最小的子序列。
思路：维护一个递增的单调栈，特殊考虑下末位的数情况，如果在栈中不抛出，如果不在栈中直接加入。
#include&lt;iostream&gt;
using namespace std;
int l=1,r=0;
const int maxn=2e5+5;
int q[maxn];
int st[maxn];
int tt[maxn];
int main()
{
    int n,k;
    cin&gt;&gt;n&gt;&gt;k;
    f.]]></description><category></category></item></channel></rss>