摘要: 二分图的题 可以分别以行列和列行建 1.二分图 #include<bits/stdc++.h> using namespace std; const int N=555; int n,m; char c[N][N]; int a[N][N],b[N][N]; int flag[N<<5],match 阅读全文
posted @ 2021-07-17 18:54 Hehe_0 阅读(52) 评论(0) 推荐(0)
摘要: 抓住题中可以转化的信息,使题面变为我们熟悉的类型 将颜色看为点,珠子作为边(由于欧拉图性质) #include<bits/stdc++.h> using namespace std; int n; //以颜色为点建图,珠子为边建图qwq int G[66][66],ind[66]; int sta; 阅读全文
posted @ 2021-07-17 14:56 Hehe_0 阅读(36) 评论(0) 推荐(0)
摘要: 注意寻找题面隐藏关系 #include<bits/stdc++.h> using namespace std; const int N=1e5+7; int n,cnt,x,tot,t; int head[N],nxt[N<<1],to[N<<1]; int match[N],flag[N]; in 阅读全文
posted @ 2021-07-17 14:51 Hehe_0 阅读(55) 评论(0) 推荐(0)
摘要: 差分约束的题 不多说 #include<bits/stdc++.h> using namespace std; const int N=1e5+7; int n,m; int head[N],nxt[N<<2],to[N<<2],edge[N<<2]; int d[N],flag[N],num[N] 阅读全文
posted @ 2021-07-17 10:48 Hehe_0 阅读(45) 评论(0) 推荐(0)