
-------【图论】
图论
Dream-chasing ant
鄙人水平不高,建立博客初心只是想留一份回忆给自己。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
图的存储
文章目录邻接矩阵邻接表链式前向星邻接矩阵邻接表链式前向星原创 2020-07-17 17:12:28 · 99 阅读 · 0 评论 -
P3916 图的遍历
传送门这道题要求出每个点能到达的最大编号。我们反向建图,这个思想很重要啊。从最大编号x开始遍历,只要遍历可以到达的点,该点的最大编号就是x.#include<bits/stdc++.h>using namespace std;const int maxn=1e5+10;int n,m;int a[maxn];vector<int> e[maxn];vo...原创 2020-04-05 14:59:33 · 165 阅读 · 0 评论 -
P5318 【深基18.例3】查找文献
传送门这道题为图的遍历,难点是优先从最小的遍历,用sort破解#include<bits/stdc++.h>using namespace std;const int maxn=1e5+10;int n,m;int v[maxn];vector<int> e[maxn];void dfs(int x,int cur){ cout<<x<...原创 2020-04-05 14:36:59 · 397 阅读 · 0 评论