摘要: 拓扑排序 一种基于 $DAG$ 图的 $O(n)$ 遍历图的算法,喜欢结合优先队列,反向建图进行考察。 tarjan强连通 补充 stack<int>q; void tarjan(int pos){ dfn[pos]=low[pos]=++cnt;//路径序号和所能到达的最小序号 bk[pos]=1 阅读全文
posted @ 2023-03-19 13:37 FJOI 阅读(21) 评论(0) 推荐(0)
摘要: ## ST表 ```cpp #include using namespace std; const int N=1e6+110; int st[N][21],m,n,k[N]; int read(){ int x=0,f=1;char c=getchar(); while(c>'9' || c='0 阅读全文
posted @ 2023-03-19 13:37 FJOI 阅读(27) 评论(0) 推荐(0)
摘要: 莫队 #include<bits/stdc++.h> using namespace std; const int N=50010,M=200100,K=1e6+2022; int read(){ int x=0,f=1;char c=getchar(); while(c>'9' || c<'0') 阅读全文
posted @ 2023-03-19 13:36 FJOI 阅读(26) 评论(0) 推荐(0)
摘要: 链接1 链接2 链接3--超全 最大流的增广路算法(最大流) FF 采用深搜 不停地寻找增广路 每找到一条 就把它减去min 把它的反向边加min 给下次搜索一个反悔的机会 #include<bits/stdc++.h> #define ll long long using namespace st 阅读全文
posted @ 2023-03-19 13:36 FJOI 阅读(63) 评论(0) 推荐(0)
摘要: 1.CRT中国剩余定理 2.拓展欧几里德 int exgcd(int a,int b,int &x,int &y){ if(b==0){x=1;y=0;return a;} int d=exgcd(b,a%b,y,x);//d是最大公约数 y-=a/b*x;return d; } 对于$ax+by= 阅读全文
posted @ 2023-03-19 13:36 FJOI 阅读(61) 评论(0) 推荐(0)
摘要: 链接1 链接2 链接3 二分图 把一个无向图的点分为两个集合 图中的每条边的两个端点分别属于两个集合 所以,二分图中没有奇数个数点的环 判定 用染色法dfs或bfs 从一个未染色的点出发 枚举它的边 如果他的下一个点颜色与他相同 则该图不是二分图 如果下一个点为未染色 则搜索它 二分图的匹配 选定二 阅读全文
posted @ 2023-03-19 13:36 FJOI 阅读(35) 评论(0) 推荐(0)
摘要: int128 高精度本质上是字符串实现的,所以把$int128$放这了。 #include <bits/stdc++.h> using namespace std; typedef unsigned __int128 LLL; LLL read() { LLL x = 0, f = 1; char 阅读全文
posted @ 2023-03-19 13:35 FJOI 阅读(22) 评论(0) 推荐(0)
摘要: 笛卡尔树 #include<bits/stdc++.h> using namespace std; const int N=1e7+10; int read(){ int x=0,f=1;char c=getchar(); while(c>'9' || c<'0'){if(c=='-')f=-1;c 阅读全文
posted @ 2023-03-19 13:35 FJOI 阅读(17) 评论(0) 推荐(0)
摘要: # Treap 通过维护堆的性质,使平衡树平衡,操作是旋转。 ```cpp #include using namespace std; const int N=1e5+2022,inf=0x3f3f3f3f; int read(){ int x=0,f=1;char c=getchar(); whi 阅读全文
posted @ 2023-03-19 13:34 FJOI 阅读(16) 评论(0) 推荐(0)
摘要: 扫描线 #include<bits/stdc++.h> #define int long long using namespace std; const int N=4e5+10; int read(){ int x=0,f=1;char c=getchar(); while(c>'9' || c< 阅读全文
posted @ 2023-03-19 13:33 FJOI 阅读(15) 评论(0) 推荐(0)
摘要: vector VECTOR set https://blog.csdn.net/qq_56067257/article/details/123252972 insert(key_value); 将key_value插入到set中 ,返回值是pair<set<int>::iterator,bool>, 阅读全文
posted @ 2023-03-19 13:32 FJOI 阅读(20) 评论(0) 推荐(0)
摘要: $\color{orange}\text{ARC-158}$ $\color{RED}\text{Performance:1703}$ $\color{GREEN}\text{time:2023.3.12}$ 比赛状态:切了 $\text{A,B}$ ,两发罚时。(写 $\text{B}$ 时忘删调 阅读全文
posted @ 2023-03-19 13:12 FJOI 阅读(166) 评论(0) 推荐(0)