
拓扑排序
Lngxling
这个作者很懒,什么都没留下…
展开
-
HDU - 1285 确定比赛名次 —— 拓扑排序
确定比赛名次Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29019 Accepted Submission(s): 11552Problem Description有N个比赛队(1原创 2017-09-13 16:11:50 · 264 阅读 · 0 评论 -
UVA - 10305 Ordering Tasks ——拓扑排序
John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task isonly possible if other tasks have already been executed.InputThe input will consist of severa原创 2017-09-13 16:14:28 · 225 阅读 · 0 评论 -
拓扑排序
拓扑排序——常用于有向图中 完成任务A 需先解决其先决事件的问题 要想解决事件A 需先解决其先决事件 可以用图中点的入度来表示 储存图用邻接表或者邻接矩阵 先顺序访问所有入度为0的顶点 并添加进队列 不断将下一顶点的入度-1 使点的入度变为0 深搜和广搜都能实现拓扑排序 时间复杂度为O(|V|+|E|) 但大规模图容易引起栈溢出 所以不涉及递归的广搜更合适些 例题:E - 确定比赛名次&&G原创 2017-07-29 17:28:42 · 259 阅读 · 0 评论 -
POJ - 366 Cow Contest
Cow ContestTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13569 Accepted: 7556DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are partic原创 2017-12-10 21:55:40 · 216 阅读 · 0 评论