上一页 1 ··· 4 5 6 7 8
摘要: 该算法的作用 可以把多个点纳入同一个集合,可以在将近O(1)的时间复杂度内找到两个点是否在同一个集合 原理实现 原理 : 比如说有10个点(1-10),开始时把他们都分到10个不同的集合里面,然后开始合并集合,例如合并1,2,3为一个集合 那么,把2, 3的祖宗结点都设为1,p[2] = 1, p[ 阅读全文
posted @ 2021-04-12 21:36 梨花满地 阅读(64) 评论(0) 推荐(0)
摘要: 问题 E: Pesky Publicans 时间限制: 1 Sec 内存限制: 128 MB 题目描述 Tax collectors in the Roman empire, called publicans, are not well perceived, and for good reason. 阅读全文
posted @ 2021-04-12 20:10 梨花满地 阅读(59) 评论(0) 推荐(0)
摘要: 题目描述 You are teaching kindergarten! You wrote down the numbers from 1 to n, in order, on a whiteboard. When you weren’t paying attention, one of your 阅读全文
posted @ 2021-04-11 22:16 梨花满地 阅读(510) 评论(0) 推荐(0)
摘要: 题目描述 There is a group of people in an internet email message group. Messages are sent to all members of the group, and no two messages are sent at the 阅读全文
posted @ 2021-04-11 20:46 梨花满地 阅读(435) 评论(0) 推荐(0)
摘要: 题目描述 A group of students is taking a True/False exam. Each question is worth one point. You, as their teacher, want to make your students look as good 阅读全文
posted @ 2021-04-11 20:11 梨花满地 阅读(636) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8