
构造
coldfresh
那我们开始吧
展开
-
Finals in arithmetic CodeForces - 625D (构造)
Vitya is studying in the third grade. During the last math lesson all the pupils wrote on arithmetic quiz. Vitya is a clever boy, so he managed to finish all the tasks pretty fast and Oksana Fillipovn...原创 2018-03-30 10:30:24 · 279 阅读 · 0 评论 -
【Codeforces Round #530】Sum in the tree(贪心构造)
做法: 我之前错误的做法是从前往后推的,优先最小,但是显然这是错误的,随便构造一个就能找到反例,当时没什么时间了,就没有怎么仔细想。因为实际上当越往根节点靠近时,这个点值应该越大越好,因为他可以以他为根子树的贡献越多,使得总体所有点权和越小,这个从直觉上就可以分析出来应该是没有问题,所以这个应该得从后往前推,如果这个点的s值没确定,那么应该取他的子节点的的s值当中的最小值。如果发现他的子节点都...原创 2019-01-07 11:56:45 · 382 阅读 · 0 评论