摘要: 1013 1013 点击查看代码 #include <bits/stdc++.h> using namespace std; vector<int> G[10010]; bool vis[10010]; int curpoint; void dfs(int index) { if(index==cu 阅读全文
posted @ 2022-02-26 22:51 勇往直前的力量 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1086 1086 发现一个问题,如果vector事先resize了的话,再用push_back()添加元素就会失败,这种情况应该像数组那样处理。All in all,要么不resize然后push_back();要么resize用下标添加。 点击查看代码 #include <bits/stdc++ 阅读全文
posted @ 2022-02-26 11:45 勇往直前的力量 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
posted @ 2022-02-26 11:37 勇往直前的力量 阅读(23) 评论(0) 推荐(0) 编辑
摘要: The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin 阅读全文
posted @ 2022-02-26 10:27 勇往直前的力量 阅读(29) 评论(0) 推荐(0) 编辑