摘要:
【题意】 【分析】 典型的二者选其一模型 【代码】 #include<bits/stdc++.h> using namespace std; typedef long long ll; int n,m,tot; const int maxn=1e5+5; const ll inf=1e18; con 阅读全文
摘要:
【题意】 【分析】 考虑到这种节点较多,而且连的边有一定性质的,特别是类似区间上的问题,我们要用线段树优化建图取做网络流 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first # 阅读全文
摘要:
【题意】 【分析】 这样去跑最大流即可,这道题目同时还考察了输出方案的问题,理解每条边的意义即可 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #define se se 阅读全文
摘要:
【题意】 【分析】 和BZOJ3158. 千钧一发基本一致 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #define se second #define lson n 阅读全文
摘要:
【题意】 【分析】 把一个点拆成两个点,两侧都连bi的边权 中间有冲突的连inf 这是两者选其一的第二种建图方式 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #defi 阅读全文
摘要:
【题意】 【分析】 这个题就是经典的二者选其一中的选/不选问题 挺神奇的建法 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #define se second #defi 阅读全文
摘要:
【题意】 每个点有一个价值,选了一个点,就不能选周围四个点,求最大的价值 【分析】 依然是很裸的黑白染色 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #define s 阅读全文
摘要:
【题意】 【分析】 黑白染色裸题 【代码】 #include<bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #define se second #define lson now<<1 #define 阅读全文
摘要:
【题意】 【分析】 黑白染色经典题 【代码】 #include <cstdio> #include <iostream> #include <cstring> #include <vector> using namespace std; const int MAXN = 1000000; const 阅读全文