摘要:
普通 #include<iostream> using namespace std; #include<algorithm> #include<cstring> const int N = 5010; int n, f[N]; int a[N]; int main() { cin >> n; for 阅读全文
摘要:
题目acwing #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 100010; int n, m; int h[N], e[N], ne[N], idx; int 阅读全文
摘要:
树和图的框架 #include<iostream> #include<algorithm> using namespace std; const int N = 10010; int h[N], e[N], ne[N], idx; //a所对应的单链表中插入b a作为根 void add(int a 阅读全文
摘要:
董晓的宽搜模板 #include <iostream> #include <cstring> #include <algorithm> #include <queue> using namespace std; const int N = 100010; int n, m, a, b; vector 阅读全文
摘要:
大佬的解析DFS #include<iostream> using namespace std; const int N = 10; int n; int path[N]; bool st[N]; void dfs(int u) { if (u == n) { for (int i = 0; i < 阅读全文
摘要:
拉链法 哈希函数:f(x) = ( x % N + N ) % N k就是下标, h[k]=x 哈希表的头节点(head指针)是idx,就是第几个插入的序号 idx没什么用,用头插法插入元素,插入和寻找都是h[k]在起作用 idx会变,当插入第二个下标为k的元素时,idx就会变成新的。 #inclu 阅读全文