会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
不离别不相遇、
陪伴是最长情的告白、
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
14
下一页
2016年3月3日
lightoj 1234
摘要: Description In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n, yo
阅读全文
posted @ 2016-03-03 19:56 我不萌、我要高冷
阅读(432)
评论(0)
推荐(0)
2016年3月1日
HDU 2602Bone Collector 01背包问题
摘要: 题意:给出一个t代表有t组数据,然后给出n,n代表有n种石头,v代表旅行者的背包容量,然后给出n种石头的价值和容量大小,求能带走的最大价值 思路:01背包问题,每种石头只有拿与不拿两种状态、(其实我是为理解dp而来的) 一维数组也能过、只是第二层必须反序来、顺序的话同一件物品可能会被取多次 贴一份W
阅读全文
posted @ 2016-03-01 16:44 我不萌、我要高冷
阅读(184)
评论(0)
推荐(0)
HDU 1114 完全背包问题
摘要: 题意:有一个存钱罐,空罐时的重量是e,满罐时的重量是f,现在有n种硬币,每一种有无限个,现在给出每一种硬币的价值p和重量w,问存钱罐中最少钱,输出最小钱,否则输出... 思路:变形的完全背包问题,只是求最小值 1 #include<cstdio> 2 #include<cstring> 3 #inc
阅读全文
posted @ 2016-03-01 16:38 我不萌、我要高冷
阅读(330)
评论(0)
推荐(0)
2016年2月28日
HDU 1596 也是最小路径Dijkstra
摘要: 1 #include<cstdio> 2 #include<cmath> 3 #include<cstring> 4 const int qq=1000+10; 5 double dist[qq]; 6 double city[qq][qq]; 7 int vis[qq]; 8 int n,m; 9
阅读全文
posted @ 2016-02-28 22:40 我不萌、我要高冷
阅读(258)
评论(0)
推荐(0)
HDU 2066最短路径Dijkstra、
摘要: 思路:枚举所有起点城市然后比较每个起点所去喜欢城市的最小距离 1 #include<cstdio> 2 #include<cmath> 3 #include<cstring> 4 const int qq=1000+10; 5 const int MAX=1e7; 6 int s[qq],e[qq]
阅读全文
posted @ 2016-02-28 22:34 我不萌、我要高冷
阅读(302)
评论(0)
推荐(0)
最短路径Dijkstra算法和Floyd算法整理、
摘要: 转载自:http://www.cnblogs.com/biyeymyhjob/archive/2012/07/31/2615833.html 最短路径—Dijkstra算法和Floyd算法 Dijkstra算法 1.定义概览 Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节
阅读全文
posted @ 2016-02-28 22:31 我不萌、我要高冷
阅读(1767)
评论(0)
推荐(0)
2016年2月27日
HDU 1879 还是prim最小生成树、
摘要: 1 #include<stdio.h> 2 #include<math.h> 3 #include<string.h> 4 const int qq=100+10,MAX=1e7; 5 int vis[qq]; 6 int lowcost[qq][qq]; 7 int minimum[qq]; 8
阅读全文
posted @ 2016-02-27 20:01 我不萌、我要高冷
阅读(197)
评论(0)
推荐(0)
HDU 1875 最小生成树prim算法
摘要: 1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cmath> 5 #include<cstring> 6 #define MAX 0xffffffff //定义一个最小生成树中不可能达到的值 7 con
阅读全文
posted @ 2016-02-27 10:52 我不萌、我要高冷
阅读(334)
评论(0)
推荐(0)
2016年2月16日
最小生成树kruskal算法、
摘要: 克鲁斯卡尔(kruskal) 1 //kruskal算法生成最小生成树、 2 3 //对边集数组Edge结构的定义 4 typedef struct 5 { 6 int begin; 7 int end; 8 int weight; 9 }Edge; 10 void Minispantree_kru
阅读全文
posted @ 2016-02-16 10:05 我不萌、我要高冷
阅读(486)
评论(0)
推荐(0)
2016年2月15日
HDU 1754线段树基本操作,建树,更新,查询
摘要: 代码线段树入门整理中有介绍、 1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 #include<cmath> 5 using namespace std; 6 const int MAXNODE=1<<19; 7 cons
阅读全文
posted @ 2016-02-15 09:45 我不萌、我要高冷
阅读(220)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
14
下一页
公告