传送门:http://www.usaco.org/index.php?page=viewproblem2&cpid=93 很容易发现,这是一个二分图的模型.竖直线是X集,水平线是Y集,若某条竖直线与水平线相交,则连边.由于目的是要没有任何两条线相交,所以二分图的边的两端不能同时取,就是要求一个二分图的最大独立集,which equals to N - 最大匹配. 然而啊然而,仍然没有一A!此题只是说给出线段两端点的坐标,并没有说x1一定<x2,y1一定<y2... 可以说这是本次月赛金…
Problem 1: Cow Calisthenics [Michael Cohen, 2010] Farmer John continues his never-ending quest to keep the cows fit by having them exercise on various cow paths that run through the pastures. These cow paths can be represented as a set of vertices co…
https://www.luogu.org/fe/problem/P3033 二分图最大独立集 注意输入的时候控制x1,y1,x2,y2的相对大小. #include<bits/stdc++.h> using namespace std; #define ll long long /* dinic begin */ const int MAXN=5000; const int MAXM=120000; //注意网络流要预留反向边 const int INF=0x3f3f3f3f; struct…