论文部分内容阅读
第一题《食物链(eat)》解题报告 摘要 算法# 算法1 算法2 时间复杂度 O(nlogn+m) O(mα(n+m,m)+n) 空间复杂度 O(n) O(n) 特殊数据结构 分离集合 分离集合 问题转述 给定某个含有n个元素的集合S,其中每个元素都具 有三种属性(A、B或C)中的一种,是根据已给出的各 个元素之间的相对关系集R来确定某两个元素之间的相对关系。 分析在读题之后我们可以简单地得出处理一条输入的流程 图如下:
The first question “food chain” problem solving report summary algorithm # algorithm 1 algorithm 2 time complexity O (nlogn + m) O (m α (n + m, m) + n) space complexity O (n) O ( n) Special Data Structure Separation Sets The separation set problems are reported for a given set S containing n elements, each of which has one of three attributes (A, B, or C), based on the given A set of relative relationships R between each element determines the relative relationship between two elements. After analyzing the questions, we can simply draw the process of processing an input as follows: