摘要:
我自己是通過深度優先搜索實現的,雖然效率不高但是思路很簡單 class Solution { public: vector<vector<int>> combine(int n, int k) { vector<vector<int> > v; DFS(1,v,n,k); return v; } p 閱讀全文
posted @ 2020-09-08 19:25
是水泵呢
閱讀(111)
評論(0)
推薦(0)
摘要:
#include<cstdio> #include<queue> #include<vector> using namespace std; const int N = 110; struct node{ int deep; vector<int> child; }Node[N];//1..N-1 閱讀全文
posted @ 2020-09-08 18:56
是水泵呢
閱讀(62)
評論(0)
推薦(0)
摘要:
#include<cstdio> #include<vector> #include<math.h> #include<queue> using namespace std; const int N = 100010; struct node{ bool isretailer=true; vecto 閱讀全文
posted @ 2020-09-08 18:29
是水泵呢
閱讀(89)
評論(0)
推薦(0)
摘要:
本題的重點是利用層序遍歷維持樹每個結點的深度數據的更新,這是層序遍歷的一個重要應用。 注意:計算葉子節點的次方時用#include<math.h>下的pow函數,不然最后一個樣例會超時 #include<cstdio> #include<vector> #include<queue> #includ 閱讀全文
posted @ 2020-09-08 17:09
是水泵呢
閱讀(101)
評論(0)
推薦(0)
浙公網安備 33010602011771號