随笔分类 -  图论

摘要:J - Til the Cows Come Home Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her 阅读全文
posted @ 2023-02-22 22:38 Keith- 阅读(27) 评论(0) 推荐(0)
摘要:E - Networking You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a 阅读全文
posted @ 2023-02-22 22:26 Keith- 阅读(41) 评论(0) 推荐(0)
摘要:B - Learning Languages 原题链接 思路 由于可以传译,所以可以将共同语言(包括传译)者视为一个集合(合并),最后查询总共集合数-1就是答案 注意 特判:有可能有公司所有人一种语言都不会,而答案不应为-1,所以需要特判 代码 点击查看代码 #include<iostream> # 阅读全文
posted @ 2023-02-19 00:41 Keith- 阅读(34) 评论(0) 推荐(0)
摘要:A - 并查集 思路 模板 注意 01串的处理 代码 点击查看代码 #include<iostream> using namespace std; #define X first #define Y second typedef pair<int,int> pii; typedef long lon 阅读全文
posted @ 2023-02-19 00:35 Keith- 阅读(38) 评论(0) 推荐(0)
摘要:D Tokitsukaze and Energy Tree 原题链接 题意 给出一棵树,将树的每个节点赋值,赋值后能够获得子数总和的能量,求可能获得的总能量最多是多少? 思路 将能量最多的赋值给层数最高的(排序) 代码 点击查看代码 #include<algorithm> #include<iost 阅读全文
posted @ 2023-01-18 21:09 Keith- 阅读(36) 评论(0) 推荐(0)