————图论————
昨日明眸
个人爱好
展开
-
POJ 1751 Highways(最小生成树prime算法)
HighwaysTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia h原创 2016-08-04 09:28:23 · 356 阅读 · 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 · 358 阅读 · 0 评论 -
#1015 : KMP算法
#1015 : KMP算法时间限制:1000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一只河蟹,于是河蟹就向小Hi和小Ho提出了那个经典的问题:“小Hi和小Ho,你们能不能够判断一段文字(原创 2016-08-09 18:43:03 · 241 阅读 · 0 评论 -
字典数入门开始题目1 : Trie树
题目1 : Trie树时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一本词典,于是小Hi就向小Ho提出了那个经典的问题:“小Ho,你能不能对于每一个我给出的字符串,都在这个原创 2016-08-09 17:15:42 · 321 阅读 · 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 · 264 阅读 · 0 评论 -
hdu2196Computer树的直径
ComputerTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5687 Accepted Submission(s): 2844Problem DescriptionA school bought the原创 2016-08-03 09:22:17 · 268 阅读 · 0 评论 -
hdu4697Park Visit(找节点)
Park VisitTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionClaire and her little friend, ykwd, are travelling in Shevchenko's Par原创 2016-08-02 19:00:35 · 258 阅读 · 0 评论 -
light oj 1094 Farthest Nodes in a Tree(树的直径模板)
Farthest Nodes in a TreeTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionGiven a tree (a connected graph with no cycles), you have to原创 2016-08-02 16:54:41 · 231 阅读 · 0 评论 -
POJ 1383--Labyrinth【树的直径】
LabyrinthTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThe northern part of the Pyramid contains a very large and complicated原创 2016-08-02 16:51:52 · 331 阅读 · 0 评论 -
POJ 2631 -- Roads in the North【树的直径 】
Roads in the NorthTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionBuilding and maintaining roads among communities in the far No原创 2016-08-02 16:47:47 · 238 阅读 · 0 评论 -
POJ1985 Cow Marathon 树的直径
Cow MarathonTime Limit:2000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John wants his cows to g原创 2016-08-02 16:44:50 · 260 阅读 · 0 评论 -
hdu4514 湫湫系列故事——设计风景线(坑,树不止一个)
湫湫系列故事——设计风景线Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 4040 Accepted Submission(s): 722Problem Description 随着杭州西湖的知名度的进一原创 2016-08-02 16:34:13 · 373 阅读 · 0 评论 -
hdu 2647 Reward(拓扑排序)
RewardTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionDandelion's uncle is a boss of a factory. As the spring festival is coming原创 2016-08-05 16:20:47 · 210 阅读 · 0 评论 -
codeforces 232A Cycles (构建图,贪心+模拟)
CyclesDescription描述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 · 382 阅读 · 0 评论