
树
鸭锁骨啦啦啦
你说贪心是无法接近你的
~~~~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
L2-011 玩转二叉树
#include<cstdio> #include<iostream> #include<queue> using namespace std; const int maxn=50; int pre_order[maxn],in_order[maxn]; int lch[maxn],rch[maxn],s[maxn]; int n; queue<int&...原创 2020-03-14 21:35:52 · 115 阅读 · 0 评论 -
L2-006 树的遍历
//需要多看看 #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<stack> #include<queue> using namespace std; const int maxn=1005; int in...原创 2020-03-14 21:13:56 · 203 阅读 · 0 评论 -
7-10 小字辈(左子右兄加强版
输入样例1: 5 1 2 0 2 4 3 3 0 0 4 0 5 5 0 0 输出样例1: 3 4 5 输入样例2: 5 2 5 3 1 2 0 3 0 0 4 0 0 5 0 4 输出样例2: 3 4 5 左孩子存 儿子,右孩子存 兄弟 #include<bits/stdc++.h> using namespace std; struct tree{ int f,l,r; tr...原创 2019-03-30 09:08:56 · 1191 阅读 · 0 评论 -
最小生成树
题目描述 如题,给出一个无向图,求出最小生成树,如果该图不连通,则输出orz 输入输出格式 输入格式: 第一行包含两个整数N、M,表示该图共有N个结点和M条无向边。(N<=5000,M<=200000) 接下来M行每行包含三个整数Xi、Yi、Zi,表示有一条长度为Zi的无向边连接结点Xi、Yi 输出格式: 输出包含一个数,即最小生成树的各边的长度之和;如果该图不连通则输出orz 方法一...原创 2019-04-01 21:20:05 · 348 阅读 · 0 评论