<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[哆啦AC梦的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/wang2147483647</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; wang2147483647]]></copyright><item><title><![CDATA[UvaLive 5031 Graph and Queries（Treap+并查集）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78321196</link><guid>https://blog.csdn.net/wang2147483647/article/details/78321196</guid><author>wang2147483647</author><pubDate>Mon, 23 Oct 2017 17:35:57 +0800</pubDate><description><![CDATA[题目地址：https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3032
思路：
1.三种操作

#include
#include
#include
#include
#include
#include
#define debug
usi]]></description><category></category></item><item><title><![CDATA[UvaLive 2197 Paint the Roads（费用流）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78306254</link><guid>https://blog.csdn.net/wang2147483647/article/details/78306254</guid><author>wang2147483647</author><pubDate>Sat, 21 Oct 2017 20:51:29 +0800</pubDate><description><![CDATA[题目地址：https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=198
思路：]]></description><category></category></item><item><title><![CDATA[Uva 11146 Insurrection（最短路+最小割）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78304382</link><guid>https://blog.csdn.net/wang2147483647/article/details/78304382</guid><author>wang2147483647</author><pubDate>Sat, 21 Oct 2017 16:16:56 +0800</pubDate><description><![CDATA[题目地址：https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2087
思路：
1.删除k个点使得点1到点n不连通。
2.拆点。将每个点拆为i和i’，容量为删除该点的花费（即为从1点到该点的最短路+n点到该点的最短路）。
3.对于原图中的无向边i-j，]]></description><category></category></item><item><title><![CDATA[Uva 10983 Buy one, get the rest free（二分+最大流）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78294859</link><guid>https://blog.csdn.net/wang2147483647/article/details/78294859</guid><author>wang2147483647</author><pubDate>Fri, 20 Oct 2017 14:15:08 +0800</pubDate><description><![CDATA[题目地址：https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1924
思路：
1.二分所需花费cost，每次只选择不大于cost的航班。
2.设源点S，汇点T。对于每个城市，表示为二元组（i，t），代表第t天处于第i个城市。从S到每一（i，0）连边，容]]></description><category></category></item><item><title><![CDATA[Sgu 438 The Glorious Karlutka River（动态流）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78290067</link><guid>https://blog.csdn.net/wang2147483647/article/details/78290067</guid><author>wang2147483647</author><pubDate>Thu, 19 Oct 2017 22:04:59 +0800</pubDate><description><![CDATA[题目地址：http://acm.sgu.ru/problem.php?contest=0&problem=438
思路：
1.由于不同时刻，两点的流量不同，故不能在一张图中求解。
2.由于任意时刻，人可在中间节点停留，故费用流无法解决此题。
3.给定所有流量限制，求最短经过时间。可通过枚举时间，将中间节点按时间拆点为(i,t)（即在时间t时的点i）。
（1）节点存在容量限制，可通过拆点解]]></description><category></category></item><item><title><![CDATA[Gym 100204G Network Wars（最小割+0/1分数规划）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78286230</link><guid>https://blog.csdn.net/wang2147483647/article/details/78286230</guid><author>wang2147483647</author><pubDate>Thu, 19 Oct 2017 16:18:03 +0800</pubDate><description><![CDATA[题目地址：http://codeforces.com/gym/100204/attachments
思路：
1.即要求求：


其中Xi=1代表选择该条边，为0代表不选择该边。
2.转化为：


即：




二分ans，设置所有边为W-ans，若一条边小于0，则直接将其加入（该边小于平均值，加入则会使最终结果更小），设所有负权边和为sum。求最小割，判断最小割+sum]]></description><category></category></item><item><title><![CDATA[Uva 10615 Rooks（二分图完美匹配+补边）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78261255</link><guid>https://blog.csdn.net/wang2147483647/article/details/78261255</guid><author>wang2147483647</author><pubDate>Tue, 17 Oct 2017 15:42:42 +0800</pubDate><description><![CDATA[题目地址：https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1556
思路：
1.给棋子染色，要求每行每列棋子颜色均不相同。
2.可以看出，所需最少颜色数为每行每列最大的棋子数，设为ans。
3.构造二分图模型，左右各n个点，若第i行第j列存在棋子，]]></description><category></category></item><item><title><![CDATA[Uva 10984 Double NP-hard（二分图）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78253724</link><guid>https://blog.csdn.net/wang2147483647/article/details/78253724</guid><author>wang2147483647</author><pubDate>Mon, 16 Oct 2017 20:19:42 +0800</pubDate><description><![CDATA[题目地址：https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1925
思路：
1.求一点集，使得其为图的最小覆盖集和最大独立集。
2.首先，若该图不为二分图，则必无解：若不为二分图，则存在奇数长度回路，设该回路上点数为2*k+1。则由定义，至多k个点在]]></description><category></category></item><item><title><![CDATA[Poj 3621 Sightseeing Cows（二分+负环判断）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78249603</link><guid>https://blog.csdn.net/wang2147483647/article/details/78249603</guid><author>wang2147483647</author><pubDate>Mon, 16 Oct 2017 14:44:42 +0800</pubDate><description><![CDATA[题目地址：http://poj.org/problem?id=3621
思路：
1.求点权值除以边权值最大的环。
2.二分答案ans，sigma（v）/sigma（e）=0。对原图中的边，设其边权值为ans*e-v，判断是否存在负环即可。
3.由于图有可能不连通，设一点0，向所有点连权值为0的边，从0点开始跑spfa判断是否存在负环即可。
#include
#include
#inclu]]></description><category></category></item><item><title><![CDATA[Hdu 1512 Monkey King（左偏树+并查集）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78228682</link><guid>https://blog.csdn.net/wang2147483647/article/details/78228682</guid><author>wang2147483647</author><pubDate>Fri, 13 Oct 2017 17:27:45 +0800</pubDate><description><![CDATA[题目地址：http://acm.split.hdu.edu.cn/showproblem.php?pid=1512
思路：
使用左偏树快速合并两堆。
#include
#include
#include
#include
using namespace std;

const int maxn=100000+50;

struct Node
{
    int val,lson,rson,d]]></description><category></category></item><item><title><![CDATA[Hdu 4417 Super Mario（主席树+二分）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78218730</link><guid>https://blog.csdn.net/wang2147483647/article/details/78218730</guid><author>wang2147483647</author><pubDate>Thu, 12 Oct 2017 19:31:57 +0800</pubDate><description><![CDATA[题目地址：http://acm.split.hdu.edu.cn/showproblem.php?pid=4417
思路：
1.查询区间内不大于x的数的个数。
2.使用主席树求区间k大值，二分k，求最后一个不大于x的k大值，则k即为元素个数。
#include
#include
#include
#include
#define lson l,m
#define rson m+1,r
#d]]></description><category></category></item><item><title><![CDATA[Ural 1028 Stars（树状数组）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78198382</link><guid>https://blog.csdn.net/wang2147483647/article/details/78198382</guid><author>wang2147483647</author><pubDate>Tue, 10 Oct 2017 22:22:06 +0800</pubDate><description><![CDATA[题目地址：http://acm.timus.ru/problem.aspx?space=1&num=1028
思路：
首先按坐标排序（先按x，后按y），按x从小到大依次处理，则点i下方的点的个数即为y坐标不大于改点的个数，使用树状数组维护即可。
#include
#include
#include
#include
using namespace std;
const int maxn=15]]></description><category></category></item><item><title><![CDATA[Ural 1003 Parity（并查集）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78197758</link><guid>https://blog.csdn.net/wang2147483647/article/details/78197758</guid><author>wang2147483647</author><pubDate>Tue, 10 Oct 2017 21:32:04 +0800</pubDate><description><![CDATA[题目地址：http://acm.timus.ru/problem.aspx?space=1&num=1003
思路：
一、
1.区间和可表示为两前缀和相减：sum[R]-sum[L-1]。若区间[L,R]和为奇数，则连边(L-1)-->R，权值为1，否则权值为0。则由a->b和b->c可推出a->c的奇偶性。
2.使用并查集维护信息，设w[i]为i到其根结点的距离。则判断时只需判断(w[L]]></description><category></category></item><item><title><![CDATA[Gym 100273L Language Recognition（Trie+Hash）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78184490</link><guid>https://blog.csdn.net/wang2147483647/article/details/78184490</guid><author>wang2147483647</author><pubDate>Mon, 09 Oct 2017 17:07:15 +0800</pubDate><description><![CDATA[题目地址：http://codeforces.com/gym/100273/attachments
思路：
1.建立Trie，显然所有叶子节点都是等效的，Hash值设为1。
2.对于非叶子节点，需将其儿子Hash值与边对应字母同时考虑。Hash[root]=sigma(Hash[son]*ch+1)，Hash[root]*=Son[root]，ch为字符，son为root的儿子节点，Son[]]></description><category></category></item><item><title><![CDATA[Poj 2970 The lazy programmer（贪心）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78176001</link><guid>https://blog.csdn.net/wang2147483647/article/details/78176001</guid><author>wang2147483647</author><pubDate>Sun, 08 Oct 2017 17:15:04 +0800</pubDate><description><![CDATA[题目地址：http://poj.org/problem?id=2970
思路：
1.按照d值从小到大排序，依次完成任务。
2.将所有已完成任务加入优先队列（a值越大越优先），若当前任务无法完成，则从队列中不断找到a值最大的任务，花费一定钱数减少完成时间，直到当前时间等于d。
3.若某任务花费值为b/a，则以后花费钱任务时间也不会减少，从队列中删除。
#include
#include
#]]></description><category></category></item><item><title><![CDATA[Gym 100206B Fire station building（三分）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78170935</link><guid>https://blog.csdn.net/wang2147483647/article/details/78170935</guid><author>wang2147483647</author><pubDate>Sat, 07 Oct 2017 18:57:21 +0800</pubDate><description><![CDATA[题目地址：http://codeforces.com/gym/100206/attachments
思路：
1.求出任意两点最短距离g（i，j），对于建在边u-v长为len的消防站（位置为x），则到点i的最短距离为min｛g[u][i]+x，len-x+g[v][i]｝(r
2.枚举每条可建消防站的边，显然总期望距离为一凹函数，三分求取最小值即可。
3.当图不连通或道路长度不足以建站时无解]]></description><category></category></item><item><title><![CDATA[Ural 1040 Airline Company（构造）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78166858</link><guid>https://blog.csdn.net/wang2147483647/article/details/78166858</guid><author>wang2147483647</author><pubDate>Fri, 06 Oct 2017 20:21:41 +0800</pubDate><description><![CDATA[题目地址：http://acm.timus.ru/problem.aspx?space=1&num=1040
思路：
1.无向连通图满足从一点出发的边数大于1的边，其标号的最大公约数为1。
2.直接从任意点开始dfs，直接按dfs顺序给所有边标号即可（对于一点相连的两条边，dfs时必有一条边进入该点，一条边离开该点，即其标号相差1，而相邻两数其gcd为1，满足条件）。
#include
#]]></description><category></category></item><item><title><![CDATA[Poj 3106 Flip and Turn（模拟+优化）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78166469</link><guid>https://blog.csdn.net/wang2147483647/article/details/78166469</guid><author>wang2147483647</author><pubDate>Fri, 06 Oct 2017 18:56:37 +0800</pubDate><description><![CDATA[题目地址：http://poj.org/problem?id=3106
思路：
一、模拟+栈优化
1、所有操作均对应与两种操作的组合，对应题目中的1和V操作。设1操作为1，V操作为0。则所有操作分别对应：







1
1


2
010


H
101


V
0


A
10


B
1010


C
101010
]]></description><category></category></item><item><title><![CDATA[Uva 10934 Dropping water balloons（递推）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78162282</link><guid>https://blog.csdn.net/wang2147483647/article/details/78162282</guid><author>wang2147483647</author><pubDate>Thu, 05 Oct 2017 18:43:54 +0800</pubDate><description><![CDATA[题目地址：https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1875
思路：
红书上分析：




#include
#include
#include
#include
using namespace std;
typedef long lo]]></description><category></category></item><item><title><![CDATA[Uva 1153 Keep the Customer Satisfied（贪心）]]></title><link>https://blog.csdn.net/wang2147483647/article/details/78161866</link><guid>https://blog.csdn.net/wang2147483647/article/details/78161866</guid><author>wang2147483647</author><pubDate>Thu, 05 Oct 2017 16:56:30 +0800</pubDate><description><![CDATA[题目地址：https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3594
思路：
从小到大排序，依次加入，若当前值超过规定时间，则从已加入的订单中删去所需时间最大的，然后将当前订单加入记录个数即可。
#include
#include
#include
#]]></description><category></category></item></channel></rss>