摘要:
Pathfinding is a task of finding a route between two points. It often appears in many problems. For exampl... 阅读全文
摘要:
Danang and Darto are classmates. They are given homework to create a permutation of N integers from 1 to N... 阅读全文
摘要:
#include #include #include #include using namespace std;const int N = 250;// 并查集维护 int belong[N];... 阅读全文
摘要:
带花树就是说一个非二分图,图中带有奇环的图,我们不能在奇环中找增广路,因为会陷入死循环,我们可以将带花树的花(奇环)部分缩成点处理,剩下的图就是一个无奇环的图。我们再找增广路,而奇环中的的点我们可以随意分配,但是... 阅读全文
摘要:
定义:如果一张无向图的N个节点(N>=2)可以分成A B两个非空子集,其中A∩B=Ø,并且在同一集合内的点之间没有相连的边,则称这张无向图为二分图。A,B分别成为这个图的左部和右部。定理:一张无向图是二分图,当且... 阅读全文
摘要:
#include#include#include#include#include#includeusing namespace std;#define read(x) scanf("%lld",&x)#defin... 阅读全文
摘要:
#include#include#include#include#include#includeusing namespace std;#define read(x) scanf("%lld",&x)#defin... 阅读全文