上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 23 下一页
摘要: 这题还是最小生成树 ==已经修建的道路的权值位0,然后再用克鲁斯卡尔算法#include#include#includeusing namespace std;const int maxn=2000;int p[maxn];struct node{ int u,... 阅读全文
posted @ 2015-12-31 08:43 __NaCl 阅读(79) 评论(0) 推荐(0)
摘要: 这题是要你求讲所有点连起来的最小的代价是多少。连起两点的代价是两个点之间的距离。。。最基本的最小生成树#include#include#include #include#includeusing namespace std;const int maxn=200;int... 阅读全文
posted @ 2015-12-31 08:43 __NaCl 阅读(194) 评论(0) 推荐(0)
摘要: 这是一道关于拓扑排序的题,并且要输出其中一种拓扑序列#include#include#include#includeusing namespace std;const int maxn=150;int c[maxn];int topo[maxn],t;int G[ma... 阅读全文
posted @ 2015-12-31 08:43 __NaCl 阅读(87) 评论(0) 推荐(0)
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1221这道题前19行给出城市的联通关系比如1 3 2 3 4 3 4 5 6 1 6 1 7 2 12 13 1 8 ... 阅读全文
posted @ 2015-12-31 08:43 __NaCl 阅读(88) 评论(0) 推荐(0)
摘要: 二叉排序树是一种左子树的值小于根,而右子树的值大于根的的一棵树,通过中序遍历可以得到一个有序的序列= =#include#include#include#include#includeusing namespace std;typedef struct node{ ... 阅读全文
posted @ 2015-12-31 08:43 __NaCl 阅读(113) 评论(0) 推荐(0)
摘要: 这两道题都是和欧拉图的判定有关,一个是有向图,一个是无向图的欧拉图的判定还有一个是有向图= =先看10129。。。我们把单词的首字母看做是入度,最后一个字符看做是初度,那么这道题就变成图中是否存在欧拉回路。判断有向图的条件是该图是连通图和最多最有两个点的出度不等于入度... 阅读全文
posted @ 2015-12-31 08:43 __NaCl 阅读(183) 评论(0) 推荐(0)
摘要: 这题其实很简单的说,第一次用邻接表来存图= =首先图的储存结构是结构体+head数组。。。其实head数组保存的struct node{ int v; int next;}V[200*200]; 假设现在有u节点,v表示的是和他邻接的点,next保存的是v... 阅读全文
posted @ 2015-12-31 08:42 __NaCl 阅读(106) 评论(0) 推荐(0)
摘要: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1498题意的意思是给你n个房间,每个房间有一个价值,每个房间可以通向一些其... 阅读全文
posted @ 2015-12-31 08:42 __NaCl 阅读(101) 评论(0) 推荐(0)
摘要: Slash Maze By filling a rectangle with slashes (/) and backslashes ( ), you can generate nice little mazes. Here is an example:As ... 阅读全文
posted @ 2015-12-31 08:42 __NaCl 阅读(141) 评论(0) 推荐(0)
摘要: 题目链接https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=473= =这题就是就是给你一个三维的图,然后给你一个起点,一个终点... 阅读全文
posted @ 2015-12-31 08:42 __NaCl 阅读(70) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 23 下一页