![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
————图论————
昨日明眸
个人爱好
展开
-
POJ 1751 Highways(最小生成树prime算法)
Highways Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %llu Submit Status Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia h原创 2016-08-04 09:28:23 · 365 阅读 · 0 评论 -
lcs最长公共子序列
#include #include #include using namespace std; char s1[1000],s2[1000]; int len1,len2,dp[1000][1000],mark[1000][1000];//如果数据太大,dp数组可以考虑滚动数组 void LCS() { int i,j; memset(dp,原创 2016-08-09 21:31:46 · 366 阅读 · 0 评论 -
#1015 : KMP算法
#1015 : KMP算法 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。 这一天,他们遇到了一只河蟹,于是河蟹就向小Hi和小Ho提出了那个经典的问题:“小Hi和小Ho,你们能不能够判断一段文字(原创 2016-08-09 18:43:03 · 246 阅读 · 0 评论 -
字典数入门开始题目1 : Trie树
题目1 : Trie树 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。 这一天,他们遇到了一本词典,于是小Hi就向小Ho提出了那个经典的问题:“小Ho,你能不能对于每一个我给出的字符串,都在这个原创 2016-08-09 17:15:42 · 325 阅读 · 0 评论 -
最小生成树prim算法实现
#include #include #define MaxInt 0x3f3f3f3f #define N 110 //创建map二维数组储存图表,low数组记录每2个点间最小权值,visited数组标记某点是否已访问 int map[N][N],low[N],visited[N]; int n; int prim() { int i,j,pos,min,result=0原创 2016-08-03 10:22:37 · 268 阅读 · 0 评论 -
hdu2196Computer树的直径
Computer Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5687 Accepted Submission(s): 2844 Problem Description A school bought the原创 2016-08-03 09:22:17 · 276 阅读 · 0 评论 -
hdu4697Park Visit(找节点)
Park Visit Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Claire and her little friend, ykwd, are travelling in Shevchenko's Par原创 2016-08-02 19:00:35 · 263 阅读 · 0 评论 -
light oj 1094 Farthest Nodes in a Tree(树的直径模板)
Farthest Nodes in a Tree Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Description Given a tree (a connected graph with no cycles), you have to原创 2016-08-02 16:54:41 · 234 阅读 · 0 评论 -
POJ 1383--Labyrinth【树的直径】
Labyrinth Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Description The northern part of the Pyramid contains a very large and complicated原创 2016-08-02 16:51:52 · 336 阅读 · 0 评论 -
POJ 2631 -- Roads in the North【树的直径 】
Roads in the North Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status Description Building and maintaining roads among communities in the far No原创 2016-08-02 16:47:47 · 246 阅读 · 0 评论 -
POJ1985 Cow Marathon 树的直径
Cow Marathon Time Limit:2000MS Memory Limit:30000KB 64bit IO Format:%lld & %llu Submit Status Description After hearing about the epidemic of obesity in the USA, Farmer John wants his cows to g原创 2016-08-02 16:44:50 · 265 阅读 · 0 评论 -
hdu4514 湫湫系列故事——设计风景线(坑,树不止一个)
湫湫系列故事——设计风景线 Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 4040 Accepted Submission(s): 722 Problem Description 随着杭州西湖的知名度的进一原创 2016-08-02 16:34:13 · 376 阅读 · 0 评论 -
hdu 2647 Reward(拓扑排序)
Reward Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Dandelion's uncle is a boss of a factory. As the spring festival is coming原创 2016-08-05 16:20:47 · 214 阅读 · 0 评论 -
codeforces 232A Cycles (构建图,贪心+模拟)
Cycles Description 描述 John Doe started thinking about graphs. After some thought he decided that he wants to paint an undirected graph, containing exactly kcycles of length 3. A cycle of len原创 2016-11-13 14:38:50 · 388 阅读 · 0 评论