
树相关
MaywrILoi
这个作者很懒,什么都没留下…
展开
-
二叉树的序遍历
二叉树的序遍历http://codevs.cn/problem/3143/ 二叉树的序遍历.模板题#include<iostream> #include<cstring> #include<cstdio> using namespace std; const int maxn = 1010; struct point { int l,r; }p[maxn]; void build(int l原创 2017-10-11 23:05:42 · 235 阅读 · 0 评论 -
树的直径模板
树的直径模板http://codevs.cn/problem/1814/最长链.模板题 对于树上的最长链,有且仅有两种情况: #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; int n,tot,a,b,ans,pos; in原创 2017-10-11 00:07:03 · 907 阅读 · 0 评论