随笔分类 - ACM之图论
0.3.1 路径
0.3.2 匹配
0.3.3 树
摘要:问题:套汇。 思路:Floyd 代码: 时间复杂度:O(N^3)
阅读全文
摘要:其他遍历见:http://www.cnblogs.com/jiu0821/p/4120017.html 算法: 代码:
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1710 Binary Tree Traversals Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3999 The order of a Tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot
阅读全文
摘要:http://acm.uestc.edu.cn/#/problem/show/913握手Time Limit: 2000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStatus一群人参加了一次聚会,其中有...
阅读全文
摘要:http://acm.uestc.edu.cn/#/problem/show/916方老师的分身 IIITime Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStatus一天的讲座结...
阅读全文
摘要:http://acm.uestc.edu.cn/#/problem/show/914方老师分身 ITime Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStatus方老师为了开更多讲...
阅读全文
摘要:代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 using namespace std;10 11 #define PI acos(-1.0)12 #define...
阅读全文
摘要:1.topology: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 using namespace std;10 11 #define EPS 1e-612 #def...
阅读全文
摘要:1 #include <fstream> 2 #include <iostream> 3 4 using namespace std; 5 6 struct node 7 { 8 char c; 9 struct node *lch,*rch; 10 }; 11 12 int count_leaf(
阅读全文
摘要:1 #include 2 #include 3 4 using namespace std; 5 6 /* 7 后序遍历的非递归实现是三种遍历方式中最难的一种。因为在后序遍历中,要保证左孩子和右孩子都已被访问并且左孩子在右孩子 8 前访问才能访问根结点,这就为流程的控制带来了难题。下面介绍两种思路。 9 第一种思路:对于任一结点P,将其...
阅读全文