Rikka with Graph Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 118    Accepted Submission(s): 52 Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, s…
HDU 6321 Dynamic Graph Matching (状压DP) Problem C. Dynamic Graph Matching Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 1796 Accepted Submission(s): 731 Problem Description In the mathematical…
Sparse Graph Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 689    Accepted Submission(s): 238 Problem Description In graph theory, the complement of a graph G is a graph H on the same vertic…
Sparse Graph Problem Description   In graph theory, the complement of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they are notadjacent in G. Now you are given an undirected graph G of N…
题意: 有N个点,M条边. 点有权值, 边有权值. Alice, Bob 分别选点. 如果一条边的两个顶点被同一个人选了, 那么能获得该权值.问 Alice - Bob? 链接:http://acm.hdu.edu.cn/showproblem.php?pid=4647 思路: 贪心. 对于一条边来说, 如果拿了一个点, 说明已经拿了该边的一半权值. 如果某边的两个的顶点分别是不同的人.  那么差值还是不变的.  如果某边的两个顶点分别是同一个人. 那么和值也不变. 所以我们可以把一个边分解到两…
Sparse Graph Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1520    Accepted Submission(s): 537 Problem Description In graph theory, the complement of a graph G is a graph H on the same verti…
Problem Description Soda has a bipartite graph with n vertices and m undirected edges. Now he wants to make the graph become a complete bipartite graph with most edges by adding some extra edges. Soda needs you to tell him the maximum number of edges…
J - 小panpan学图论 Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status 小panpan不会图论,所以图论专题他非常刻苦地学习图论. 今天他认真地学习了萌神的ppt,学习了一下Floyd算法,手持两把锟斤拷的他, 口中疾呼烫烫烫,马上找了到OJ上找了道FLoyd的题: n个点,m边的无向连通图,无重边,无自环,每条边的长度都是1,求任意两点之间的…
题意 给定一棵 \(n\) 个节点, \(m\) 条边的无向图,每个点有点权,有 \(q\) 个询问,每次询问若删去存在一个节点权值在 \([L,R]\) 范围外的边,剩下的图构成了多少个连通块(询问间相互独立). \(1\leq n,q \leq 10^5\) \(1\leq m \leq 2\times 10^5\) 思路 题目意思在简化一下,就是求连接两个点权在 \([L,R]\) 中的边和原图中的所有节点构成的连通块数. 对于两维的询问,在没有强制在线的情况下,可以考虑离线消维.我们把询…
http://acm.hdu.edu.cn/showproblem.php?pid=5876 题意: 在补图中求s到其余各个点的最短路. 思路:因为这道题目每条边的距离都是1,所以可以直接用bfs来做. 处理的方法是开两个集合,一个存储当前顶点可以到达的点,另一个存储当前顶点不能到达的点.如果可以到达,那肯定由该顶点到达是最短的,如果不能,那就留着下一次再判. #include<iostream> #include<algorithm> #include<cstring>…