
拓扑排序
文章平均质量分 85
詹明捷
此博客停止更新,迁移至www.zhanmingjie.com
展开
-
拓扑排序 SRM 660 Div2 Medium: PrivateD2party
This would mean that whenever a friend A dislikes a friend B, friend A must receive the invitation before B. Define "A must come before B" as a requirement: "B requires A" meaning that if we want to invite B, we must invite A first.原创 2015-08-03 19:22:03 · 792 阅读 · 0 评论 -
连单词成欧拉路 欧拉回路+字典树+并查集 POJ 2513 Colored Sticks
http://poj.org/problem?id=2513 题意: 给你很多对单词,单词相当于一个点,一对单词相当于一条边,问这么多对的单词能否组成一条欧拉路,要求每条边都要经过。 解析: 题目数据很大,每个单词最多10个字母,据说用map映射会TLE。 所有要改用字典树进行hash。 判断欧拉路径或者回路需要满足两个条件。 图上所有点联通 度数为奇数个的节点原创 2015-10-02 15:56:27 · 743 阅读 · 0 评论