随笔分类 - 图论——二分图——匈牙利算法/KM
摘要:HDU 2255 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; #define N 306 int n,e[N][N]; int match[N],slac
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3140 如果只有两维,那就是二分图最小点覆盖 现在是三维,但是a*b*c<=5000,说明最小的那一维不会超过17 将最小的那一维作为正方形的高 然后枚举要消哪些层,剩下的层看成一层 做最小点覆盖 注意
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5727 阶乘 爆搜阴性宝石的排列,二分图最大匹配判断最多能使多少个阳性宝石不褪色 注: 1、O(n-1 !) 即可 2、dfs枚举全排列下一个放啥,是阶乘再乘n级别,用next_permutation阶乘复杂度
阅读全文
摘要:http://poj.org/problem?id=3216 n个地点,m个任务 每个任务有工作地点,开始时间,持续时间 最少派多少人可以完成所有的任务 传递闭包之后最小路径覆盖 Repairing Company Time Limit: 1000MS Memory Limit: 131072K T
阅读全文
摘要:http://poj.org/problem?id=2594 题意: 给出一个由n个顶点m条边组成的有向无欢图 求最少用多少路径,使得这些路径可以覆盖所有的点 每个点可以被多条路径覆盖 先floyd求一遍传递闭包,然后最小路径覆盖 Treasure Exploration Time Limit: 6
阅读全文
摘要:T1 [HAOI2010]软件安装 https://daniu.luogu.org/problem/show?pid=2515 树上背包,如果有i必须有j,j作为i的父节点 O(nm²) #include<cstdio> #include<cstring> #include<iostream> #i
阅读全文
摘要:Guardian of Decency http://poj.org/problem?id=2771 Time Limit: 3000MS Memory Limit: 65536K Description Frank N. Stein is a very conservative high-scho
阅读全文
摘要:Matrix http://acm.hdu.edu.cn/showproblem.php?pid=2119 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descrip
阅读全文
摘要:1433: [ZJOI2009]假期的宿舍 Description Input Output Sample Input 1 3 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 Sample Output ˆ ˆ HINT 对于30% 的数据满足1 ≤ n ≤ 12。对于100% 的数据满
阅读全文
摘要:Antenna Placement http://poj.org/problem?id=3020 Time Limit: 1000MS Memory Limit: 65536K Description The Global Aerial Research Centre has been allott
阅读全文
摘要:Asteroids http://poj.org/problem?id=3041 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22191 Accepted: 12038 Description Bessie wants to
阅读全文