![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
训练补题
文章平均质量分 87
御坂埋豆℡ ¹ ₂ ³ ₄
废物大一Acmer 性别男 爱好女
展开
-
Codeforces Round#722(div1) A,C题 题解
**A. Parsa’s Humongous Tree(树上DP-互斥问题)传送门:A. Parsa’s Humongous Tree题意:给定一棵树,给每个节点在各自特定区间[li,ri]内选定一个权值,定义边的权值为 abs(val[u]-val[v])求解整棵树的所有边的权值和的最大值。首先根据贪心可得一定在所有节点取得最小或最大值的时候取得最优解,那么这道题就转化成了一个典型的树上DP互斥问题。对于每个节点用0,1状态标记其取最小或最大值,最后从根节点逐层DP便可得到最优解。#incl原创 2021-05-25 16:21:58 · 317 阅读 · 0 评论 -
Codeforces 图论tag题合集(1)
Codeforce 图论tag题 2021.5CR#693(div3)————G. Moving to the Capital (树上DP)There are n cities in Berland. The city numbered 1 is the capital. Some pairs of cities are connected by a one-way road of length 1.Before the trip, Polycarp for each city found out原创 2021-05-24 01:23:58 · 2361 阅读 · 0 评论 -
F. Fitness Baker
F. Fitness Baker 数学问题time limit per test0.5 sememory limit per test256 megabytesinputstandard inputoutputstandard outputBaker is living in a new post-modern house. A house of size N consists of 5 wings arranged in a cross shape, where each wing conta原创 2021-04-20 09:46:33 · 274 阅读 · 0 评论