摘要:
挺有意思的一道题,嘛,还是那句话,不要被固有思维给限制了 嘛,我一开始找点来逐步分析,而后才看了题解发现时找边的关系,我很容易找题目不关紧要的条件啊..... 首先这个题有两种建图方法 第一种,直接把minl maxl串起来,流量无穷大,费用为0,然后对于一个区间,Li,Ri 从Li Ri连一条边, 阅读全文
posted @ 2020-01-22 20:45
After_rain
阅读(126)
评论(0)
推荐(0)
摘要:
嘛,你把图分类一下 分成横坐标+纵坐标为奇偶... 然后在图上跑一个二分图最大权匹配 然后就是max(ans, 全部的-ans) 我代码写得有点... 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int inf=9999999; 5 in 阅读全文
posted @ 2020-01-22 01:09
After_rain
阅读(194)
评论(1)
推荐(0)
摘要:
#include<bits/stdc++.h> using namespace std; int k,n; int tot=-1,h[3005],ans=0,sum=0; struct node{ int from,next,to,rest,full; }e[100005]; void add(in 阅读全文
posted @ 2020-01-22 01:06
After_rain
阅读(168)
评论(0)
推荐(0)
摘要:
有两个引理 设Fi为以i结尾的最长递增子序列 1.当Fi为1是,i 可能是后面最长递增子序列的起点 2,当Fi取最大值时,同时有多个,那么这多个都是前面最长递增子序列的终点 根据这个性质来网络流.... 就没了 建边条件也很好想 1 #include<bits/stdc++.h> 2 using n 阅读全文
posted @ 2020-01-22 01:03
After_rain
阅读(223)
评论(0)
推荐(0)
摘要:
比较有意思的题 题意:给你n个柱子,问你可以在上面放多少个编号连续且每根柱子上相邻的编号为平方数的球洗澡时候想的,根据平方数这个关系建边,然后枚举多少个柱子,然后再在图上跑最小路径覆盖,若路径条数大于柱子数,那么珠子数-1就是答案 我写的有点....t了,但不想改 #include<bits/std 阅读全文
posted @ 2020-01-22 01:00
After_rain
阅读(177)
评论(0)
推荐(0)
摘要:
网络流水题,详细看代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int n,m,tot=-1,h[3005],ans=0,sum=0; 5 struct node{ 6 int from,next,to,rest,full; 7 in 阅读全文
posted @ 2020-01-22 00:58
After_rain
阅读(138)
评论(0)
推荐(0)
摘要:
这我没什么好说的,那天补个证明 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int m,n,tot=-1,h[10005],ans=0; 5 struct node{ 6 int from,next,to,rest; 7 int last 阅读全文
posted @ 2020-01-22 00:57
After_rain
阅读(114)
评论(0)
推荐(0)
摘要:
1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int m,n,tot=-1,h[10005],ans=0,bianhao[505][505],co[505],sum=0; 5 bool wll[10005]; 6 struct node{ 阅读全文
posted @ 2020-01-22 00:56
After_rain
阅读(110)
评论(0)
推荐(0)
摘要:
#include<bits/stdc++.h> using namespace std; int m,n,tot=-1,h[1005],ans=0,tp=0; struct node{ int from,next,to,rest; int last; }e[10005]; void add(int 阅读全文
posted @ 2020-01-22 00:53
After_rain
阅读(104)
评论(0)
推荐(0)
摘要:
过水不解释 #include<bits/stdc++.h> using namespace std; long long tot=-1,sum=0,h[1005],flow[1005],g[1005],ans=0,dis[1005],ans2=0,inf=999999; bool vis[1005] 阅读全文
posted @ 2020-01-22 00:51
After_rain
阅读(107)
评论(0)
推荐(0)