摘要:
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 阅读全文
摘要:
1086 1086 发现一个问题,如果vector事先resize了的话,再用push_back()添加元素就会失败,这种情况应该像数组那样处理。All in all,要么不resize然后push_back();要么resize用下标添加。 点击查看代码 #include <bits/stdc++ 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文