。。。

导航

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页

2017年8月1日 #

【图论】【最短路径模板+邻接表】【Floyed+Dijsktra+Bellman-Ford+SPFA】【最短路算法对比分析】

摘要: ACM模板【最短路】:最短路是不包含回路的简单路径。【Floyed】多源最短路,即要求求出图中每两个顶点之间的最短路。虽然Floyed的复杂度是O(n^3),但是4行却简单很多,本质上是动态规划算法。 思想:从i号顶点到j号顶点只经过前k号顶点的最短路径。#define INF 99... 阅读全文

posted @ 2017-08-01 07:38 大学僧 阅读(530) 评论(0) 推荐(0) 编辑

【数学基础】【快速幂运算模板】

摘要: ACM模板【快速幂取模运算】//取模运算(a*b)%c = (a%c)*(b%c)%c int PowerMod(int a, int b, int c){ int ans = 1; a = a % c; while(b>0) { if(b % ... 阅读全文

posted @ 2017-08-01 07:26 大学僧 阅读(177) 评论(0) 推荐(0) 编辑

【搜索】【广搜模板】

摘要: ACM模板C++queue的应用struct note{ int x; //横坐标 int step; //步数 int y; //纵坐标 }; void BFS(note front_head)//BFS { queueQ;//建立空队... 阅读全文

posted @ 2017-08-01 06:50 大学僧 阅读(398) 评论(0) 推荐(0) 编辑

2017年7月31日 #

【动态规划】【子序列模板】

摘要: ACM模板【最长上升子序列】输出长度while(scanf("%s%s",s1+1,s2+1)!=EOF) { l1 = strlen(s1+1); l2 = strlen(s2+1); for(i = 0; i f[i][j-1])... 阅读全文

posted @ 2017-07-31 18:45 大学僧 阅读(169) 评论(0) 推荐(0) 编辑

[置顶] 【ACM模板】——hello_chengdongni 随着姿势提升,不定期补充

摘要: 【序】 整理这个【ACM模板】,主要是为了我们队有一个熟悉进而能快速查询的知识库。 不断完善的过程,也是对自己学习知识的整理,同时对学习过程的记录。 --by chengdongni 2017/7/31 【目录】 1.动态规划 2.图论 3.数学基础 4.字符串 5.搜索 6.数据结构 7.STL 【动态规划】 1.背包问题 2.子序列问题 【图论】 1.最小生成树 2.最短路(+... 阅读全文

posted @ 2017-07-31 15:44 大学僧 阅读(114) 评论(0) 推荐(0) 编辑

【搜索入门专题1】 hdu1242 J - Rescue c++ stl容器之优先队列+BFS

摘要: RescueProblem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M #include#include#i... 阅读全文

posted @ 2017-07-31 07:40 大学僧 阅读(232) 评论(0) 推荐(0) 编辑

2017年7月30日 #

【搜索入门专题1】E - Farm Irrigation 【BFS】ZOJ 2412

摘要: Farm IrrigationBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are p... 阅读全文

posted @ 2017-07-30 17:43 大学僧 阅读(135) 评论(0) 推荐(0) 编辑

【搜索入门专题1】hdu1253 【BFS】 F - 胜利大逃亡

摘要: 胜利大逃亡Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-... 阅读全文

posted @ 2017-07-30 13:31 大学僧 阅读(196) 评论(0) 推荐(0) 编辑

【搜索入门专题1】hdu2717 H - Catch That Cow 【BFS】

摘要: Catch That CowProblem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a po... 阅读全文

posted @ 2017-07-30 10:16 大学僧 阅读(175) 评论(0) 推荐(0) 编辑

【搜索入门专题1】hdu1548 G - A strange lift 【BFS】

摘要: A strange liftProblem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 #include#include... 阅读全文

posted @ 2017-07-30 09:34 大学僧 阅读(114) 评论(0) 推荐(0) 编辑

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页