dfs
文章平均质量分 90
indiewar
擅长各种乱搞
展开
-
树与图的深度优先遍历(总结向,dfs序,深度和重心)
dfs 1 void dfs(int x) { vis[x] = 1; for(int i = head[x];i;i = next[i]) { int y = ver[i]; if(vis[y]) continue; dfs(y); } } 2 VI e[maxn]; void...原创 2018-07-31 21:30:19 · 393 阅读 · 0 评论 -
2018 CCPC网络赛1009 Tree and Permutation (HDU6446)(dfs or 树形dp)
Tree and Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 169 Accepted Submission(s): 57 Problem Description There are N vert...原创 2018-08-25 20:28:21 · 337 阅读 · 0 评论