摘要: An anagram is a word or phrase formed by rearranging the letters of another word or phrase, using all the original letters exactly once, such as "post 阅读全文
posted @ 2020-04-16 16:56 AlexLIN· 阅读(245) 评论(0) 推荐(0)
摘要: 题意: 一开始所有点都是花园 1为首都(即根) 现在n个点里弄k个工厂,而密探都在工厂点上 密探回首都时每经过一个花园时幸福度+1 密探一定走最短路 问最大幸福度之和 思路:BFS求出每个节点的深度,然后再减掉每个节点儿子所做的贡献,思路在代码中(DFS更简单) 代码: #include <iost 阅读全文
posted @ 2020-04-16 11:59 AlexLIN· 阅读(214) 评论(0) 推荐(0)