
------树型图结------
键盘里敲打出的巨人
这个时代带给我太多太多,我也要回馈这个时代!!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
求按字典序第k大的数字
通过字典树去求,类似线段树的查询方法 思路: 每个节点存入放前缀相同的字符串个数 然后查询时对每个子树的数量进行判断,从前缀大的往小的遍历,找到对应的,进行深度遍历。 代码: #include <bits/stdc++.h> using namespace std; const int mx = 1e5; struct tree{ int count_s; vect...原创 2020-03-08 13:07:05 · 789 阅读 · 0 评论 -
徐州 icpc 区域赛 M. Kill the tree 树的重心
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f const int mx = 2e5+100; vector<int>ve[mx]; int so[mx], sou[mx], sum[mx], n, h[mx]; int ff[mx]; ...原创 2019-12-11 09:22:44 · 301 阅读 · 0 评论