2016年5月27日

摘要: 1 2 #include <cstdio> 3 #include <iostream> 4 #include <cstring> 5 #include <algorithm> 6 #include <queue> 7 #include <vector> 8 #include <cmath> 9 #d 阅读全文

posted @ 2016-05-27 15:09 yyjxx2010xyu 阅读(101) 评论(0) 推荐(0) 编辑

摘要: 很久以前就想做,后来弃坑了。 最近又在群里有人问了类似的问题,艾老师说是斯坦纳树(%%%) 就是状压DP,然后用Spfa对状态进行转移. 1 2 #include <iostream> 3 #include <cstring> 4 #include <cstdio> 5 #include <algo 阅读全文

posted @ 2016-05-27 11:00 yyjxx2010xyu 阅读(140) 评论(0) 推荐(0) 编辑

摘要: 用线段树维护建图,即把用线段树把每个区间都标号了,Tree1中子节点有到达父节点的单向边,Tree2中父节点有到达子节点的单向边. 每次将源插入Tree1,汇插入Tree2,中间用临时节点相连。那么Tree1中的所用子节点都可以到达,Tree2中的所用子节点。 感觉很有道理啊,以前从来没用用线段树这 阅读全文

posted @ 2016-05-27 10:55 yyjxx2010xyu 阅读(537) 评论(0) 推荐(0) 编辑

摘要: 突然发现我不会分层图最短路,写一发。 就是同层中用双向边相连,用单向边连下一层 1 #include <cstdio> 2 #include <algorithm> 3 #include <iostream> 4 #include <string> 5 #include <cstring> 6 #i 阅读全文

posted @ 2016-05-27 07:41 yyjxx2010xyu 阅读(195) 评论(0) 推荐(0) 编辑