
>>>>>>>>>>DFS
【DFS】
<-krush->
十年破壁
https://github.com/Wheeeeeeeeels
展开
-
【PTA-1143】 最低公共祖先
【PTA-1143】 最低公共祖先 分析: LCA + 离散化 + 建树 #include <iostream> #include <cstring> #include <unordered_map> #include <algorithm> using namespace std; const int N = 10010; int m, n; int in[N], pre[N], seq[N]; unordered_map<int, int>原创 2020-07-21 23:53:47 · 221 阅读 · 0 评论 -
【PAT-1094】 The Largest Generation (25分)
【PAT-1094】 The Largest Generation (25分) 分析: 简单DFS算法 注意:数据的处理,以及根结点从1开始 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; const int maxn = 110; int n, m; bool g[maxn][maxn]; int cnt[原创 2020-07-21 17:39:28 · 174 阅读 · 0 评论