<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Eagle222的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Eagle222</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Eagle222]]></copyright><item><title><![CDATA[[HNOI2003]激光炸弹]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/125871329</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/125871329</guid><author>Eagle222</author><pubDate>Tue, 19 Jul 2022 15:24:44 +0800</pubDate><description><![CDATA[一种新型的激光炸弹，可以摧毁一个边长为m的正方形内的所有目标。现在地图上有n个目标，用整数xi​,yi​表示目标在地图上的位置，每个目标都有一个价值vi​.激光炸弹的投放是通过卫星定位的，但其有一个缺点，就是其爆破范围，即那个边长为m的边必须与x轴,y轴平行。若目标位于爆破正方形的边上，该目标不会被摧毁。现在你的任务是计算一颗炸弹最多能炸掉地图上总价值为多少的目标。...]]></description><category></category></item><item><title><![CDATA[Codeforces Round #771 (Div. 2) (A - C)]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/123077249</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/123077249</guid><author>Eagle222</author><pubDate>Tue, 22 Feb 2022 22:05:46 +0800</pubDate><description><![CDATA[A题 （思维）
题意：给出一个数列，然后可以任选一段区间，把这段区间倒转过来，求经过倒转后字典序最小的一个数列。
样例：
输入：
4
1
1
3
2 1 3
4
1 4 2 3
5
1 2 3 4 5
输出：
1
1 2 3
1 2 4 3
1 2 3 4 5
解题思路：找到第一次出现a[i]!=i的位置，标记这个位置以及i的值，然后寻找i的值所在的位置，将这段区间反转即可。
AC代码：
#include &lt;bits/stdc++.h&gt;
using namespace std;

const i]]></description><category></category></item><item><title><![CDATA[Borg Maze (最小生成树+bfs）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119749551</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119749551</guid><author>Eagle222</author><pubDate>Tue, 17 Aug 2021 10:13:14 +0800</pubDate><description><![CDATA[Borg Maze
题目描述：
The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Each Borg individual is linked to the col]]></description><category></category></item><item><title><![CDATA[ACM Contest and Blackout (次小生成树kruskal）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119677976</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119677976</guid><author>Eagle222</author><pubDate>Fri, 13 Aug 2021 16:22:00 +0800</pubDate><description><![CDATA[ACM Contest and Blackout
题目描述：
In order to prepare the “The First National ACM School Contest” (in 20??) the major of the city
decided to provide all the schools with a reliable source of power. (The major is really afraid of
blackoutsJ). So, in order to d]]></description><category></category></item><item><title><![CDATA[Arctic Network (最小生成树 Kruskal +贪心）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119677117</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119677117</guid><author>Eagle222</author><pubDate>Fri, 13 Aug 2021 16:05:05 +0800</pubDate><description><![CDATA[Arctic Network
题目描述：
The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceive]]></description><category></category></item><item><title><![CDATA[Building a Space Station (最小生成树 Kruskal）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119676372</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119676372</guid><author>Eagle222</author><pubDate>Fri, 13 Aug 2021 15:38:08 +0800</pubDate><description><![CDATA[Building a Space Station
题目描述：
You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.
The space station is made up with ]]></description><category></category></item><item><title><![CDATA[Highways (最小生成树 Kruskal）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119675415</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119675415</guid><author>Eagle222</author><pubDate>Fri, 13 Aug 2021 15:13:48 +0800</pubDate><description><![CDATA[Highways
题目描述：
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has already constructed a number of highways connecting some of the mos]]></description><category></category></item><item><title><![CDATA[Jungle Roads （最小生成树）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119674675</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119674675</guid><author>Eagle222</author><pubDate>Fri, 13 Aug 2021 14:41:21 +0800</pubDate><description><![CDATA[Jungle Roads
题目描述：
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expens]]></description><category></category></item><item><title><![CDATA[最小生成树 （Prime算法+Kruskal算法）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119638356</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119638356</guid><author>Eagle222</author><pubDate>Thu, 12 Aug 2021 14:38:22 +0800</pubDate><description><![CDATA[Prime算法：
[关于算法的过程演示：]
(https://blog.youkuaiyun.com/lqcsp/article/details/14118871)

]]></description><category></category></item><item><title><![CDATA[最长上升子序列（LIS）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119052982</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119052982</guid><author>Eagle222</author><pubDate>Sat, 24 Jul 2021 09:43:13 +0800</pubDate><description><![CDATA[最长上升子序列
题目描述：
给定一个长度为 N 的数列，求数值严格单调递增的子序列的长度最长是多少。
输入格式
第一行包含整数 N。
第二行包含 N 个整数，表示完整序列。
输出格式
输出一个整数，表示最大长度。
数据范围
1≤N≤1000，
−109≤数列中的数≤109
输入样例：
7
3 1 2 1 8 5 6
输出样例：
4
题解：最长上升子序列，由于数据范围较小，这里可以用时间复杂度为o(n^2)的方法，也就是用动态规划，具体做法如下：
1、设多维数组：这里只需要一维数组即可，dp[ i ]代表以第]]></description><category></category></item><item><title><![CDATA[Stock Exchange（LIS优化）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119052776</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119052776</guid><author>Eagle222</author><pubDate>Sat, 24 Jul 2021 09:11:52 +0800</pubDate><description><![CDATA[Stock Exchange
题目描述：
The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned about the evolution of the stock exchange. He follows stock prices every day looking ]]></description><category></category></item><item><title><![CDATA[饭卡（动态规划+贪心）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/119002535</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/119002535</guid><author>Eagle222</author><pubDate>Sat, 24 Jul 2021 08:44:19 +0800</pubDate><description><![CDATA[饭卡
题目描述：
电子科大本部食堂的饭卡有一种很诡异的设计，即在购买之前判断余额。如果购买一个商品之前，卡上的剩余金额大于或等于5元，就一定可以购买成功（即使购买后卡上余额为负），否则无法购买（即使金额足够）。所以大家都希望尽量使卡上的余额最少。
某天，食堂中有n种菜出售，每种菜可购买一次。已知每种菜的价格以及卡上的余额，问最少可使卡上的余额为多少。
Input
多组数据。对于每组数据：
第一行为正整数n，表示菜的数量。n&lt;=1000。
第二行包括n个正整数，表示每种菜的价格。价格不超过50。
第三行]]></description><category></category></item><item><title><![CDATA[数字三角形(dp)]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/118998696</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/118998696</guid><author>Eagle222</author><pubDate>Thu, 22 Jul 2021 15:52:53 +0800</pubDate><description><![CDATA[数字三角形
题目描述：
观察下面的数字金字塔。
写一个程序来查找从最高点到底部任意处结束的路径，使路径经过数字的和最大。每一步可以走到左下方的点也可以到达右下方的点。
7
3   8
8   1   0
2   7   4   4
4   5   2   6   5
在上面的样例中,从 7 \to 3 \to 8 \to 7 \to 57→3→8→7→5 的路径产生了最大
输入格式
第一个行一个正整数 rr ,表示行的数目。
后面每行为这个数字金字塔特定行包含的整数。
输出格式
单独的一行,包含那个可能得到]]></description><category></category></item><item><title><![CDATA[棋盘问题（DFS）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/117533287</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/117533287</guid><author>Eagle222</author><pubDate>Thu, 03 Jun 2021 20:24:22 +0800</pubDate><description><![CDATA[棋盘问题（DFS）
在一个给定形状的棋盘（形状可能是不规则的）上面摆放棋子，棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列，请编程求解对于给定形状和大小的棋盘，摆放k个棋子的所有可行的摆放方案C。
Input
输入含有多组测试数据。
每组数据的第一行是两个正整数，n k，用一个空格隔开，表示了将在一个n*n的矩阵内描述棋盘，以及摆放棋子的数目。 n &lt;= 8 , k &lt;= n
当为-1 -1时表示输入结束。
随后的n行描述了棋盘的形状：每行有n个字符，其中 # 表示棋盘区]]></description><category></category></item><item><title><![CDATA[Red and Black（DFS）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/117532715</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/117532715</guid><author>Eagle222</author><pubDate>Thu, 03 Jun 2021 19:46:22 +0800</pubDate><description><![CDATA[Red and Black
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can’t move on red tiles, he can move only on b]]></description><category></category></item><item><title><![CDATA[Oil Deposits（DFS）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/117532113</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/117532113</guid><author>Eagle222</author><pubDate>Thu, 03 Jun 2021 19:00:56 +0800</pubDate><description><![CDATA[Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits.
GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides
the land into numerous square plots. It then ]]></description><category></category></item><item><title><![CDATA[[CQOI2010]扑克牌]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/116948256</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/116948256</guid><author>Eagle222</author><pubDate>Mon, 17 May 2021 20:53:21 +0800</pubDate><description><![CDATA[标题[CQOI2010]扑克牌(二分答案）
链接：https://ac.nowcoder.com/acm/problem/19916
来源：牛客网
题目描述
你有n种牌，第i种牌的数目为ci。另外有一种特殊的牌：joker，它的数目是m。你可以用每种牌各一张来组成一套牌，也可以用一张joker和除了某一种牌以外的其他牌各一张组成1套牌。比如，当n=3时，一共有4种合法的套牌：{1,2,3}, {J,2,3}, {1,J,3}, {1,2,J}。 给出n, m和ci，你的任务是组成尽量多的套牌。每张牌最多只能]]></description><category></category></item><item><title><![CDATA[小咪买东西（二分+贪心+01分数规划）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/116710585</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/116710585</guid><author>Eagle222</author><pubDate>Wed, 12 May 2021 15:51:50 +0800</pubDate><description><![CDATA[小咪买东西（二分+贪心+01分数规划）
小咪是一个土豪手办狂魔，这次他去了一家店，发现了好多好多（n个）手办，但他是一个很怪的人，每次只想买k个手办，而且他要让他花的每一分钱都物超所值，即：买下来的东西的总价值/总花费=max。请你来看看，他会买哪些东西吧。
输入描述:
多组数据。
第一行一个整数T，为数据组数。
接下来有T组数据。
对于每组数据，第一行两个正整数n，k，如题。
接下来n行，每行有两个正整数ci，vi。分别为手办的花费和它对于小咪的价值。
输出描述:
对于每组数据，输出一个数，即能得到的总价]]></description><category></category></item><item><title><![CDATA[Graveyard Design(尺取法）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/116429552</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/116429552</guid><author>Eagle222</author><pubDate>Wed, 05 May 2021 20:25:29 +0800</pubDate><description><![CDATA[Graveyard Design(尺取法）
题目描述：
King George has recently decided that he would like to have a new design for the royal graveyard. The graveyard must consist of several sections, each of which must be a square of graves. All sections must have different number ]]></description><category></category></item><item><title><![CDATA[pairs（尺取）]]></title><link>https://blog.youkuaiyun.com/Eagle222/article/details/116425799</link><guid>https://blog.youkuaiyun.com/Eagle222/article/details/116425799</guid><author>Eagle222</author><pubDate>Wed, 05 May 2021 15:41:11 +0800</pubDate><description><![CDATA[pairs（尺取）
题目描述：
John has n points on the X axis, and their coordinates are (x[i],0),(i=0,1,2,…,n−1). He wants to know how many pairs&lt;a,b&gt; that |x[b]−x[a]|≤k.(a&lt;b)
Input
The first line contains a single integer T (about 5), indicating the number of]]></description><category></category></item></channel></rss>