上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 董晓的宽搜模板 #include <iostream> #include <cstring> #include <algorithm> #include <queue> using namespace std; const int N = 100010; int n, m, a, b; vector 阅读全文
posted @ 2024-07-29 11:21 某朝 阅读(33) 评论(0) 推荐(0)
摘要: 大佬的解析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 < 阅读全文
posted @ 2024-07-28 21:06 某朝 阅读(35) 评论(0) 推荐(0)
摘要: 简单用法 阅读全文
posted @ 2024-07-28 15:28 某朝 阅读(9) 评论(0) 推荐(0)
摘要: 拉链法 哈希函数:f(x) = ( x % N + N ) % N k就是下标, h[k]=x 哈希表的头节点(head指针)是idx,就是第几个插入的序号 idx没什么用,用头插法插入元素,插入和寻找都是h[k]在起作用 idx会变,当插入第二个下标为k的元素时,idx就会变成新的。 #inclu 阅读全文
posted @ 2024-07-27 21:36 某朝 阅读(33) 评论(0) 推荐(0)
摘要: 插入一个数 heap[++size]=x; up(size); 求集合当中的最下值 heap[1]; 删除最小值 heap[1]=heap[size]; size--; down(1); 删除任意一个元素 heap[k]=heap[size]; size--; up(k); down(k); 修改任 阅读全文
posted @ 2024-07-27 17:46 某朝 阅读(22) 评论(0) 推荐(0)
摘要: // 关闭输入输出缓存,使效率提升 ios::sync_with_stdio(false); // 解除cin和cout的默认绑定,来降低IO的负担使效率提升 cin.tie(NULL); cout.tie(NULL); 阅读全文
posted @ 2024-07-27 16:21 某朝 阅读(44) 评论(0) 推荐(0)
摘要: 一共两个操作:合并和查询。 开始是没有并集的,得先合并再查询。 #include<iostream> using namespace std; const int N = 100010; int p[N]; int n, m; //p[x]=find(p[x]),直到找到它的祖宗节点,之后返回祖宗节 阅读全文
posted @ 2024-07-27 16:06 某朝 阅读(20) 评论(0) 推荐(0)
摘要: Trie树 阅读全文
posted @ 2024-07-27 11:41 某朝 阅读(14) 评论(0) 推荐(0)
摘要: 董晓 阅读全文
posted @ 2024-07-26 15:04 某朝 阅读(23) 评论(0) 推荐(0)
摘要: 单调栈 视频连接 #include<iostream> using namespace std; const int N = 100010; int stk[N], tt; int main() { int n; cin >> n; while (n--) { int x; scanf("%d", 阅读全文
posted @ 2024-07-25 19:21 某朝 阅读(30) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页