摘要:
一 二分图 建立源点 S 与 1∼m 的所有飞行员连容量为 1 的边,将剩下的飞行员向汇点 T 连一条边,再将所给搭配连容量为 1 的边,求 S 至 T 的最大流即可 为了方便,将源点 S 设为 0,T 设为 n+1。 二 上下界可行流 三 最大权闭合图 最小点权覆盖集 二分图最小点权覆盖集解决的是 阅读全文
摘要:
转自acwing 1.询问次数大 // c[a][b] 表示从a个苹果中选b个的方案数 for (int i = 0; i < N; i ++ ) for (int j = 0; j <= i; j ++ ) if (!j) c[i][j] = 1; else c[i][j] = (c[i - 1] 阅读全文
摘要:
https://blog.csdn.net/xiaoming_p/article/details/79644386 阅读全文
摘要:
转自acwing tire int son[N][26], cnt[N], idx; // 0号点既是根节点,又是空节点 // son[][]存储树中每个节点的子节点 // cnt[]存储以每个节点结尾的单词数量 // 插入一个字符串 void insert(char *str) { int p = 阅读全文
摘要:
选自acwing 整数二分 bool check(int x) {/* ... */} // 检查x是否满足某种性质 // 区间[l, r]被划分成[l, mid]和[mid + 1, r]时使用: int bsearch_1(int l, int r) { while (l < r) { int 阅读全文
摘要:
转自https://www.luogu.com.cn/blog/user19027/solution-p3369 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int MAXL=1 阅读全文
摘要:
主席树/转自b站agoh #include<iostream> #include <vector> #include <algorithm> using namespace std; const int maxn = 2e5 + 5; int a[maxn]; std::vector<int> v; 阅读全文
摘要:
https://www.cnblogs.com/liuyongliu/p/10315760.html 阅读全文
摘要:
const int maxn=1e5+10; int a[maxn], t[maxn], b[maxn]; int n; scanf("%d",&n); for(int i=1; i<=n; i++) scanf("%d",&a[i]),t[i]=a[i]; sort(t+1,t+n+1); m=u 阅读全文
摘要:
https://blog.csdn.net/A_Comme_Amour/article/details/79356220 阅读全文