返回顶部
摘要: DFS序 一般与线段树等综合运用,就是将树转换为线段,存在线段树中 点击查看代码 void dfs(int now) { vis[now]=1; a[++dfscnt]=x/shuzu[x];//用途线段树 if(l==r)st[rt].val=a[l] in[x]=dfscnt; for(int 阅读全文
posted @ 2024-03-30 20:50 wlesq 阅读(2) 评论(0) 推荐(0) 编辑
摘要: https://csacademy.com/app/graph_editor/ 强连通分量(有向边) 常见题 建好有向图 找强连通分量,同时记录每个强连通分量中节点的个数 找节点个数最小的强连通分量 点击查看代码 struct Edge { int to,next; }edge[N]; void a 阅读全文
posted @ 2024-03-30 20:04 wlesq 阅读(10) 评论(0) 推荐(0) 编辑
摘要: Update2024.7.30 P2044 [NOI2012] 随机数生成器 唐题,但是需要龟速乘法 点击查看代码 #include <bits/stdc++.h> #define speed() ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); 阅读全文
posted @ 2024-03-30 20:04 wlesq 阅读(10) 评论(1) 推荐(0) 编辑