摘要: #include <stdio.h> const int z = 1024; int n, m; struct NODE { int outdex; int head; int degre; } node[z]; struct EDGE { int t, next; } edge[z<<1]; in 阅读全文
posted @ 2022-06-05 21:27 bikuhiku 阅读(5) 评论(0) 推荐(0) 编辑
摘要: #include "bits/stdc++.h" using namespace std; const int z = 131024; //又是一个基于dfs的算法; int n, m; struct EDGE { int t, next; } edge[z<<1]; int head[z], cn 阅读全文
posted @ 2022-06-05 21:08 bikuhiku 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int z = 1024; int parent[z]; void initial(const int key) { for(int i = 1;i <= key;++i) parent[i] = 阅读全文
posted @ 2022-06-05 21:06 bikuhiku 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; class dc_CHAIN { private : struct NODE { int val; NODE *pre; NODE *suc; }; void conduct_insert(int v,NOD 阅读全文
posted @ 2022-06-05 21:04 bikuhiku 阅读(2) 评论(0) 推荐(0) 编辑
摘要: $\text{\color{red}分块}$ $\text{存储:}$ struct BLOCK { int start, end; int tag, sum; BLOCK() {tag = sum = 0; } } block[g]; #define st(i) block[i].start #d 阅读全文
posted @ 2022-06-05 21:03 bikuhiku 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 大佬的字符串讲解 废稿 $KMP$与前缀函数$prefix(n)$ #include <bits/stdc++.h> using namespace std; const int z = 65536; int prefix[z]; void get_prefix(char *key) { int l 阅读全文
posted @ 2022-06-05 21:00 bikuhiku 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 今天的题又用到了这个已经吃灰了的东西,来复习一下。 #include <stdio.h> #include <string.h> #include <vector> using namespace std; const int N = 4096+1024; vector<pair<int,int>> 阅读全文
posted @ 2022-06-05 20:59 bikuhiku 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int z = 1024; int parent[z], n, m; struct edge{ int f, t, w; bool operator <(const edge x) const{ r 阅读全文
posted @ 2022-06-05 20:56 bikuhiku 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 一般$floyd$ #include<bits/stdc++.h> using namespace std; const int z = 128; int m, n, dis[z][z], pre[z][z], start, end; void print(int e) { if(!pre[star 阅读全文
posted @ 2022-06-05 20:55 bikuhiku 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 由于比赛中SPFA成为卡数据的众矢之的,请避免在图中路径权值为负以外的情况下使用 #include<bits/stdc++.h> using namespace std; const int z = 1024; struct edge{ int t, w; int next; } line[z*4] 阅读全文
posted @ 2022-06-05 20:54 bikuhiku 阅读(19) 评论(5) 推荐(0) 编辑
摘要: 众所周知,$LCA$分为离线和在线$(\text{ST表 or 树上倍增})$两种。其主要思想是:设,我的父辈为我的$0$辈祖先,以此类推,则我的$j-1$辈祖先的$j-1$辈祖先是我的$j$辈祖先。 #include "bits/stdc++.h" using namespace std; con 阅读全文
posted @ 2022-06-05 20:45 bikuhiku 阅读(6) 评论(0) 推荐(0) 编辑
摘要: \(\color{red}{\texttt{1.DP}}\) 背包DP 线性DP 区间DP 坐标DP 树形DP 单调队列优化DP 斜率优化DP 状态压缩DP 概率期望DP 决策单调性优化DP 数位DP \(\color{red}{\texttt{2.图论}}\) \(\color{cyan}{\te 阅读全文
posted @ 2022-06-05 20:34 bikuhiku 阅读(141) 评论(0) 推荐(0) 编辑