PAT - L2 - 011 玩轉二叉樹(分治)

  思路:將整棵樹劃分成 n 個子樹 坑點:maxn 最小取 49 (我也不知道爲啥,題目明明是 n<30)   代碼如下: #include<bits/stdc++.h> using namespace std; const int maxn = 50; // 試了幾次,發現最小取 49,可以過 int a[maxn],b[maxn]; struct node{ int l,r; }tree
相關文章
相關標籤/搜索