<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Qianyri的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/Nrtostp</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; Nrtostp]]></copyright><item><title><![CDATA[linux aliyun yum源]]></title><link>https://blog.csdn.net/Nrtostp/article/details/88844665</link><guid>https://blog.csdn.net/Nrtostp/article/details/88844665</guid><author>Nrtostp</author><pubDate>Wed, 27 Mar 2019 14:49:29 +0800</pubDate><description><![CDATA[1、备份系统自带的yum源

[root@ ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载和自己操作系统版本对应的yum源

[root@ ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyu...]]></description><category></category></item><item><title><![CDATA[阿里云CentO S网站部署]]></title><link>https://blog.csdn.net/Nrtostp/article/details/88265669</link><guid>https://blog.csdn.net/Nrtostp/article/details/88265669</guid><author>Nrtostp</author><pubDate>Thu, 07 Mar 2019 00:15:35 +0800</pubDate><description><![CDATA[一、JDK安装

查看CentOS自带JDK是否已安装


			1
			
			
			[root@test ~]# yum list installed |grep java
			
		若有自带安装的JDK，应如下操作进行卸载CentOS系统自带Java环境


			1

			2

			3

			4

			5

			6

			7

			8

			9

			10
			
...]]></description><category></category></item><item><title><![CDATA[ZOJ4062 Plants vs. Zombies 二分]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83794017</link><guid>https://blog.csdn.net/Nrtostp/article/details/83794017</guid><author>Nrtostp</author><pubDate>Tue, 06 Nov 2018 20:50:32 +0800</pubDate><description><![CDATA[ZOJ4062 Plants vs. Zombies

一机器人给植物浇水，浇水之前必须移动一格，移动后必须浇水，从1~n的位置上有n个植物，每个植物都有自己的生长速度，

每浇一次生长一次，机器人初始位置为0，把每种方案浇灌下最低的植物高度作为方案值，求最大的方案值

最大化最小值二分：二分最大方案值，每次模拟计算方案的最小花费是否超出机器人最大的行走距离，若不超出扩大否则缩小


#inclu...]]></description><category></category></item><item><title><![CDATA[codeforce626 E. Simple Skewness 二分]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83793922</link><guid>https://blog.csdn.net/Nrtostp/article/details/83793922</guid><author>Nrtostp</author><pubDate>Tue, 06 Nov 2018 20:42:35 +0800</pubDate><description><![CDATA[codeforce626 E. Simple Skewness

均值-中位数 最大的子集

枚举中值，二分区间大小

要使 均值-中位数 最大，所以最大化均值，即从最后取最大的L个数，从中位数前取相邻的L个数

若区间扩大均值扩大则扩大，否则缩小


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=2e5+5;
i...]]></description><category></category></item><item><title><![CDATA[Wannafly27 C	蓝魔法师 树形DP]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83443230</link><guid>https://blog.csdn.net/Nrtostp/article/details/83443230</guid><author>Nrtostp</author><pubDate>Sat, 27 Oct 2018 09:06:55 +0800</pubDate><description><![CDATA[Wannafly27 C 蓝魔法师

给定一棵树，删除一些边，使每个连通块不超过k个节点

表示第i个节点的子树对其父节点提供j个连通量的方案数






#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=2e3+5;
const int MOD=998244353;
int n,K;
struct P
{
    ...]]></description><category></category></item><item><title><![CDATA[codeforce1073 C. Vasya and Robot 二分]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83416975</link><guid>https://blog.csdn.net/Nrtostp/article/details/83416975</guid><author>Nrtostp</author><pubDate>Fri, 26 Oct 2018 16:29:07 +0800</pubDate><description><![CDATA[codeforce1073 C. Vasya and Robot

给定N个操作和一个终止点(x,y)求改变最小的区间操作区间R-L+1，使N个操作之后到达终止节点

二分区间长度mid，预处理区间位置偏移量，尺取每个长度为mid的区间（可以全都修改），若存在则扩大区间，否则缩小区间


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
cons...]]></description><category></category></item><item><title><![CDATA[Polya置换群计数]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83350604</link><guid>https://blog.csdn.net/Nrtostp/article/details/83350604</guid><author>Nrtostp</author><pubDate>Wed, 24 Oct 2018 21:02:41 +0800</pubDate><description><![CDATA[波利亚计数（群论）

POJ2154 Color

求用m种颜色给n个物品染色的方案数--旋转

根据Polya定理有



此题中m=n


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
int t,n,p;
int euler(int n)
{
    int ans=n;
    for(int i=2;i*i&amp;lt;=n;i++)
 ...]]></description><category></category></item><item><title><![CDATA[codeforce893 F. Subtree Minimum Query 线段树合并]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83349620</link><guid>https://blog.csdn.net/Nrtostp/article/details/83349620</guid><author>Nrtostp</author><pubDate>Wed, 24 Oct 2018 19:56:17 +0800</pubDate><description><![CDATA[F. Subtree Minimum Query

给定一棵树，每个节点都有自己的权值，对于每个询问，查询x的子树中与x深度差不超过y的节点的最小权值

对树上的每一个节点以深度建立动态线段树，父节点合并子节点的线段树，O(logn)查询


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=1e5+5;
const ...]]></description><category></category></item><item><title><![CDATA[ZOJ4027 Sequence Swapping 线性DP]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83315215</link><guid>https://blog.csdn.net/Nrtostp/article/details/83315215</guid><author>Nrtostp</author><pubDate>Tue, 23 Oct 2018 21:16:28 +0800</pubDate><description><![CDATA[ZOJ4027 Sequence Swapping

给定一个括号序列，仅有'()'时左右括号可以相互交换，每个括号都有自己的价值a[i]，每次交换费用为a[i]*a[i+1];

求最高的费用

每个‘（’括号只能与右边相邻的‘）’交换位置，表示第i个左括号到达j位置的最大费用



等于第i个左括号到达位置j的费用+位置j右边的最大的


#include&amp;lt;bits/stdc++.h&amp;g...]]></description><category></category></item><item><title><![CDATA[codeforce625 D. Finals in arithmetic 构造]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83311209</link><guid>https://blog.csdn.net/Nrtostp/article/details/83311209</guid><author>Nrtostp</author><pubDate>Tue, 23 Oct 2018 18:24:47 +0800</pubDate><description><![CDATA[D. Finals in arithmetic

给定一个长度小于1e5的数b，求数a+~a==b，a没有前导零

考虑进位过程中除第一个数位外，没有对称的L和R使b[L]&amp;lt;b[R],所以只要判断第一个数位即可

进位过程中，只有进1位和不进位两种情况，此外都为非法，所以b[L]==b[R]或b[L]-b[R]==1

在判断完第一个数位的特殊情况（为1，且与最后一位不对称）后，其他的位数都...]]></description><category></category></item><item><title><![CDATA[树形DP专题]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83241983</link><guid>https://blog.csdn.net/Nrtostp/article/details/83241983</guid><author>Nrtostp</author><pubDate>Sun, 21 Oct 2018 15:39:28 +0800</pubDate><description><![CDATA[HDU1520 Anniversary party

给定棵树和每个节点的权值，相邻父子节点的不可重复选取，求其可以取到的最大权值


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=6e3+5;
int n,a[MAX],d[MAX];
struct P
{
    int to,nxt;
}e[MAX];
int...]]></description><category></category></item><item><title><![CDATA[数位DP专题]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83241663</link><guid>https://blog.csdn.net/Nrtostp/article/details/83241663</guid><author>Nrtostp</author><pubDate>Sun, 21 Oct 2018 15:07:13 +0800</pubDate><description><![CDATA[不要62

给定一个[L,R]的区间，统计其中数位上不包含62和4的个数

记忆化搜索，每次标记上一位是否为6，并判断这一位是否为4或2，递推即可


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=1e5+5;
int L,R,a[20];
long long dp[20][2];
long long dfs(in...]]></description><category></category></item><item><title><![CDATA[codeforce404 D. Minesweeper 1D DP递推]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83241227</link><guid>https://blog.csdn.net/Nrtostp/article/details/83241227</guid><author>Nrtostp</author><pubDate>Sun, 21 Oct 2018 14:15:33 +0800</pubDate><description><![CDATA[给定一个一维矩阵，其中包含‘1’、‘2’、‘0’、‘*’、‘？’，扫雷小游戏——1表示左右有一个雷，2表示左右都有雷，0表示左右都没有雷，*表示雷，？表示未知，求其中有多少种可能的情况，若该图自相矛盾也输出0

表示档期位置为L，当前位置若是雷则为1，否则为0，下一位置若是雷则为1，否为0

递推时需要判断：根据不同情况分类讨论


#include&amp;lt;bits/stdc++.h&amp;gt;
us...]]></description><category></category></item><item><title><![CDATA[codeforce612 E. Wet Shark and Blocks 矩阵快速幂加速DP]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83241127</link><guid>https://blog.csdn.net/Nrtostp/article/details/83241127</guid><author>Nrtostp</author><pubDate>Sun, 21 Oct 2018 14:06:15 +0800</pubDate><description><![CDATA[codeforce612 E. Wet Shark and Blocks

有b个块，每个块中有相同的n个元素，在每个块中取1个元素，使这b个数所组成的b位整数%x==k，求此方法数

在第一个块中取a,a'=a%x，第二个块中一个元素与a'所组成的数为b=a'*10+b,b'=b%x

以此类推，最终可得到模最后几位得到k的状态

转移方程：类似邻接矩阵的n次方，某个点的值表示达到这个点的方案数...]]></description><category></category></item><item><title><![CDATA[Junit反射测试私有函数]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83210985</link><guid>https://blog.csdn.net/Nrtostp/article/details/83210985</guid><author>Nrtostp</author><pubDate>Sat, 20 Oct 2018 10:03:09 +0800</pubDate><description><![CDATA[导入包：Java.lang.Class


import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.junit.Test;

Class clazz = Class.forName(&quot;&quot;package&quot;.&quot;java&quot;&quot;);

/...]]></description><category></category></item><item><title><![CDATA[codeforce884 D. Boxes And Balls 构造哈夫曼树求解合并最小费用]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83142289</link><guid>https://blog.csdn.net/Nrtostp/article/details/83142289</guid><author>Nrtostp</author><pubDate>Thu, 18 Oct 2018 10:25:39 +0800</pubDate><description><![CDATA[codeforce884 D. Boxes And Balls

给定n个球，每个球有一定价值，求将其按照价值的分类的最小价值

逆过程：将n个一定价值的球合并到一起的最小费用，构造哈夫曼树：带权路径长度最短的树，权值较大的结点离根较近


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=2e5+5;
int n;
...]]></description><category></category></item><item><title><![CDATA[2014西安区域赛]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83117333</link><guid>https://blog.csdn.net/Nrtostp/article/details/83117333</guid><author>Nrtostp</author><pubDate>Wed, 17 Oct 2018 20:53:51 +0800</pubDate><description><![CDATA[2014西安区域赛

K.Last Defences

参考题解

给定两个数A，B（&amp;lt;1e18）S0=A，S1=B，Si=| Si-1- Si-2 |，求Si不同值的个数

假设A=11，B=3，简单计算可得序列S：11，3，8，5，3，2，1，1，0，1，0~

仔细观察可以看出：8=11-1*3，5=11-2*3，2=11-3*3，3出现的次数为11%3-1，产生的新数字个数为A/B
...]]></description><category></category></item><item><title><![CDATA[codeforce895 D. String Mark 有重复元素的排列数]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83114416</link><guid>https://blog.csdn.net/Nrtostp/article/details/83114416</guid><author>Nrtostp</author><pubDate>Wed, 17 Oct 2018 17:52:19 +0800</pubDate><description><![CDATA[codeforce895 D. String Mark

给定两个相同长度的字符串S1和S2，求由S1重新排列产生S3，且字典序（S1&amp;lt;S3&amp;lt;=S2）的种类数

不同的题解

我的题解：O（NlgN）

分别统计字典序小于S2和小于S1的排列数，Ans=Ans2-Ans1-1（不能与S1相同）

有重复元素的排列数：sum表示元素总数,cnt[]表示元素个数



统计S1中每个字符串...]]></description><category></category></item><item><title><![CDATA[codeforce 961 F. k-substrings 字符串多重Hash]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83092053</link><guid>https://blog.csdn.net/Nrtostp/article/details/83092053</guid><author>Nrtostp</author><pubDate>Tue, 16 Oct 2018 16:53:52 +0800</pubDate><description><![CDATA[codeforce 961 F. k-substrings

给定一个字符串，每次在串的两边减去一个字符求其每次减去之前最长的L（前缀==后缀）

hash 10次 减小冲突


#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
const int MAX=1e6+5;
const int HASH=10;
int AC[HASH]={131,1...]]></description><category></category></item><item><title><![CDATA[POJ 3974 Palindrome Hash+二分]]></title><link>https://blog.csdn.net/Nrtostp/article/details/83064856</link><guid>https://blog.csdn.net/Nrtostp/article/details/83064856</guid><author>Nrtostp</author><pubDate>Mon, 15 Oct 2018 21:13:22 +0800</pubDate><description><![CDATA[POJ 3974 Palindrome

求最长回文子串的长度


#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;string.h&amp;gt;
#include&amp;lt;algorithm&amp;gt;
using namespace std;
const int MAX=1e6+5;
const long long P=131;
long long power[MAX],ha1[M...]]></description><category></category></item></channel></rss>