3
CrispyCommand's Blog
source link: https://crispycommand.moe/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一些极限习题
[洛谷 P1978] 集合
题目大意:给出一棵 n 个点的树,若树上两点 u,v 满足距离为 2,则产生 wu×wv 的联合权值。求出树上最大的联合权值和所有联合权值的和。权值之和对 10007 取余。1≤n≤200000,0<wi≤10000。
题目大意:给出一颗 n 个结点的二叉树,每个结点可以染成红色,绿色或蓝色,每个结点和相邻的结点颜色必须不同,同一个结点的子结点颜色也必须不同,问最多和最少有多少个点能被染成绿色。1≤n≤5×105。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK