摘要: 设一个n个节点的二叉树tree的中序遍历为(l, 2, 3, …, n),其中数字 1, 2, 3, …, n为节点编号。每个节点都有一个分数(均为正整数),记第j个节点的分数为,tree及它的每个子树都有一个加分,任一棵子树subtree(也包含tree本身)的加分计算方法如下: subtree的 阅读全文
posted @ 2020-04-05 18:25 poozhai 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 修改操作 完整代码 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; const int maxn = 1e8; int c[m 阅读全文
posted @ 2020-04-05 18:11 poozhai 阅读(568) 评论(1) 推荐(1) 编辑