上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 63 下一页
摘要: 邻接表 阅读全文
posted @ 2020-03-04 15:27 晴屿 阅读(102) 评论(0) 推荐(0) 编辑
摘要: ```//只有出现墙的时候,才会出现一行/列多个点的情况//那么可以考虑缩点,以行为例//如果某一行没有墙,那么这一列整体所成一个点//如果有墙,那么把没有墙的部分缩成一个点//当换行时,记得点数++ #include#include #define INF 0x3f3f3f3f#define LL long longconst int N=1000+5;using namespace std;i... 阅读全文
posted @ 2020-03-04 14:55 晴屿 阅读(75) 评论(0) 推荐(0) 编辑
摘要: ```#include #include using namespace std;const int M=100000+5;int n;int h[M*2],mx[M*2],my[M*2];int vis[M];int e[M*2],ne[M*2],idx;int read(){ int res=0,ch,flag=0; if((ch=getchar())=='-') ... 阅读全文
posted @ 2020-03-03 16:19 晴屿 阅读(96) 评论(0) 推荐(0) 编辑
摘要: ```//构建二分图#include #include typedef long long ll;using namespace std;const int N=155;const int INF=0x3f3f3f3f;struct Edge { int from,to;} edge[N*N];int tot,n,m;int read() { int res=0,ch,flag=0; if((ch... 阅读全文
posted @ 2020-03-03 15:59 晴屿 阅读(87) 评论(0) 推荐(0) 编辑
摘要: ```#include using namespace std;const int maxn = 505;bool g[maxn][maxn], vis[maxn];int match[maxn];int val[maxn], keep[maxn];int a[maxn], b[maxn], c[maxn], d[maxn];int t, n, h, m;bool dfs(int u) { for... 阅读全文
posted @ 2020-03-03 15:41 晴屿 阅读(135) 评论(0) 推荐(0) 编辑
摘要: ```#include#includeusing namespace std;const int N=1e5;const int maxn=1e3;int e[N],ne[N],h[N],idx;void add(int a,int b){ e[idx]=b; ne[idx]=h[a]; h[a]=idx++;}int n,m,xN,yN;int link[N],num[maxn][maxn],m... 阅读全文
posted @ 2020-03-03 15:24 晴屿 阅读(83) 评论(0) 推荐(0) 编辑
摘要: ```#include#includeusing namespace std;typedef long long LL;const int N = 5e3+10;int map[110][110];int match[N], st[N];int n, m, k;bool dfs(int x){ for (int i = 1;i <= m;i++) { if (map[x]... 阅读全文
posted @ 2020-03-03 15:03 晴屿 阅读(74) 评论(0) 推荐(0) 编辑
摘要: ```#include#include#includeusing namespace std;const int N=1e5;//点数的最大值int e[N],ne[N],idx,h[N];int K,M,N;void init() { idx=0; memset(h,-1,sizeof(h));}void addedge(int a,int b) { e[idx]=b; ne[idx]=h[a]... 阅读全文
posted @ 2020-03-03 14:56 晴屿 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 这个题有点坑,用邻接表存过不了,难受 阅读全文
posted @ 2020-03-03 14:43 晴屿 阅读(77) 评论(0) 推荐(0) 编辑
摘要: ```#include #define PI acos(-1.0)#define E 1e-9#define INF 0x3f3f3f3f#define LL long longconst int N=1000+5;using namespace std;int n;bool vis[N];//vis[i]表示是否在交替路中int match[N];//存储连接点int e[N],ne[N],h[... 阅读全文
posted @ 2020-03-03 14:17 晴屿 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 63 下一页