illusions专题

codeforces COMPFEST-13 I. Illusions of the Desert 树剖

I. Illusions of the Desert (rating: 2300) 链接 https://codeforces.com/contest/1575/problem/I 题意 给一棵n个节点的树,点权为ai 。 要求对链做区间查询,单点修改。查的是边权和,边权的定义为: wab = max(|ax+ay|,|ax−ay|)。 input 6 4 10 -9 2 -1 4