HDU 5536 字典樹

  題意:就是公式。 這現場賽O(n^3)能過,覺得太沒天理了。   做法:字典樹,枚舉兩個數,然後在字典樹上貪心的跑。 #include <bits/stdc++.h> using namespace std; const int MAXN = 100010; struct Trie { int ch[2],size; }T[MAXN]; int root = 1,tot =
相關文章
相關標籤/搜索