2015年3月8日
摘要: #include#includeusing namespace std;const int MAX=1010;int n;int arr[MAX]; //存放原始数组int arrI=0;int CBT[MAX]; //二叉排序树层序遍历序列【思维】中序遍历在数组中存放的就是层序... 阅读全文
posted @ 2015-03-08 17:04 Evence 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;const int MAX=1010;int n,m; //n个节点,m个非叶子节点 long long int S; //待测权值long long int weight[M... 阅读全文
posted @ 2015-03-08 16:31 Evence 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;const int MAX=100010;int DEPest=0;int root=-1,N;double P,r,sum=0;vector child[MAX]; //child[父亲][孩子]... 阅读全文
posted @ 2015-03-08 14:37 Evence 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;const int MAX=100010;int DEPest=0,times=0;vector child[MAX]; //child[父亲][孩子] 二维数组表示树形结构void DFS(int root,i... 阅读全文
posted @ 2015-03-08 13:59 Evence 阅读(209) 评论(0) 推荐(0) 编辑
摘要: #include#includeint main(){ int n; scanf("%d",&n); while(n--) { char str[110]; scanf("%s",str); int len=strlen(str); int numP=0,numT=0... 阅读全文
posted @ 2015-03-08 11:25 Evence 阅读(175) 评论(0) 推荐(0) 编辑