Loading

该文被密码保护。 阅读全文
posted @ 2019-03-12 19:27 fridayfang 阅读(9) 评论(0) 推荐(0) 编辑
摘要: (写给自己看)匈牙利算法(最大匹配)和KM算法(最佳匹配) 匈牙利算法 思想 不断寻找增广路,每次寻得增广路,交换匹配边和非匹配边,则匹配点数+1 这里增广路含义:交错路,即从未匹配点出发经过未匹配边 匹配边 未匹配边 ..... 未匹配边 Konig定理:无权二分图的最大匹配=最小覆盖点集, "证 阅读全文
posted @ 2019-03-12 18:49 fridayfang 阅读(216) 评论(0) 推荐(0) 编辑
摘要: LCA 倍增法 题目又做不下去来写题解了 算法思想 类似于ST表的思想维护dp[i][j]:节点i向上跳2^j高度的的节点 转移方程 $dp[i][j]=dp[dp[i][j 1]][j 1]$注意理解依赖关系,dp[i][j]状态的确定需要dp[x][j 1] 所以在每次需要先得到[j 1]的所有 阅读全文
posted @ 2019-03-07 22:19 fridayfang 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 61 (Rated for Div. 2) 题解 教育场真的好好教育了我(原来教育场是 7problems/2h) A. Regular Bracket Sequence 题意 给出四组"((","()",")(","))"的个数,判断能否排 阅读全文
posted @ 2019-03-07 00:22 fridayfang 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 拓扑排序 题目做的烦,题解写着玩 "POJ 2762 Going from u to v or from v to u?" 有向图,之间定义这样的关系,u能到达v或者v能到达u,则满足关系 观察知,即拓扑排序中队列中不能有两个节点 code "POJ 3687 Labeling Balls" 重量为 阅读全文
posted @ 2019-02-26 19:35 fridayfang 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round 542 (Div. 2) 题目做不下去的我写一写题解 A. Be Positive 水题,考虑正数,负数个数是否$\geq \lceil \frac{n}{2} \rceil$ B. Two Cakes 给定位置大小为1...n的蛋糕,每种大小共两份,要求两个人从最 阅读全文
posted @ 2019-02-26 18:36 fridayfang 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round #541 (Div. 2) 确认过眼神,是div2的人 a Sea Battle 题意: 将两个紧邻的矩形围起来需要的方块数 周长+4 b Draw 题意: 给定出现的分数,求最多可能出现的平局数 计算$(x_i:y_i) to (x_{i+1},y_{i+1})$ 阅读全文
posted @ 2019-02-24 16:41 fridayfang 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 简要记录题解思路 f:battle City bfs+优先队列 每次入队前进行标记,每次出队都上当前最短的路径 bfs+优先队列似乎就是dijkstra算法 ?? code struct Edge{ int u,v,w,next; //Edge(int u_,int v_,int w_):u(u_) 阅读全文
posted @ 2019-02-22 22:22 fridayfang 阅读(220) 评论(0) 推荐(0) 编辑
摘要: bfs+优先队列 代码 cpp //bfs // include include include include include include using namespace std; define CL(a,b) memset(a,b,sizeof(a)) const int maxm=305; 阅读全文
posted @ 2019-02-21 17:26 fridayfang 阅读(239) 评论(0) 推荐(0) 编辑
摘要: vj线段树专题题解 单点更新模板 cpp // include include include include include include using namespace std; define maxn 20010 struct poster{ int lb,rb;//left bound } 阅读全文
posted @ 2019-02-10 17:06 fridayfang 阅读(206) 评论(0) 推荐(0) 编辑