摘要: HDU 4857 大意:如题所示。。。。。 思路:拓扑排序,逆向见图,用链式向前星,优先队列,逆序输出答案,主要就是用vector会T。 1 #include <iostream> 2 #include <algorithm> 3 #include <vector> 4 #include <queu 阅读全文
posted @ 2018-04-22 16:22 gefhg 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 有时图用邻接矩阵存太浪费时,就会用邻接表,一般来说用vector存更方便,但是vector太慢,如果数据太大容易TLE,这时就用链式向前星,相当于链表。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using 阅读全文
posted @ 2018-04-22 16:12 gefhg 阅读(799) 评论(0) 推荐(0) 编辑