摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1060解题思路:拓扑排序 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 1060 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=91解题思路:BFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 1091 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #i...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2913解题思路:BFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 2913 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 ...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=649解题思路:BFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 1649 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=8解题思路:DFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 1008 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #in...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2165解题思路:DFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 2165 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 ...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1412解题思路:DFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 2412 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 ...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=709解题思路:DFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 1709 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1110解题思路:DFS搜索 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: zoj 2110 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 ...
阅读全文
摘要:题目链接:http://poj.org/problem?id=1659知识扩展:(Havel-Hakimi 定理)由非负整数组成的非增序列 s: d1, d2, ··· , dn(n≥2, d≥1) 是可图的,当且仅当序列 s1: d2-1, d3-1, ··· , dd1+1-1, dd1+2,··· , dn是可图的。序列s1中有 n-1 个非负整数,s 序列中d1后的前d1个度数(即 d2~dd1+1)减 1 后构成 s1中的前d1个数。 1 #include 2 #include 3 using
阅读全文