- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 Sicily. Walk This Way
在这道题中用了个小技巧,根据是否能乘车来判断距离,若能乘车,则距离为0,不能则为dis代码如下#include #include #include #include #include #include #include #include using namespace std;const int maxn = 10001;int dis[101]
2015-01-15 23:20:44 280
原创 Sicilly 1031. Campus (Floyd 算法)
用惯了Dijkstra,尝试着用老师上课教的Floyd算法。Floyd算法是一个经典的动态规划算法,改算法利用了中间节点的概念,简单地说就是求一点 i 到 一点 j 的的距离,可以通过其中中间点进而进行求解。详情可以参考一下博客:http://www.cppblog.com/wing/archive/2011/03/10/141511.html#include
2015-01-13 23:54:21 284
原创 Sicily 1321. Robot (不一样的宽搜)
题目描述Karell Incorporated has designed a new exploration robot that has the ability to explore new terrains, this new robot can move in all kinds of terrain, it only needs more fuel to move in rough
2015-01-13 23:28:26 542
原创 求逆序数对(归并排序)
推荐一个今天收获的博客,该博客将归并排序解释地相当清楚,并且有C++语言的实现方法http://wangkuiwu.github.io/2014/04/28/merge-sort/主要是解决逆序数对如题1007. Inversion Number题目描述There is a permutation P with n integer
2015-01-09 00:48:21 795
原创 强连通块数(深搜实现+并查集实现)
Graph Problemconnected components in undirected graph题目描述输入一个简单无向图,求出图中连通块的数目。输入格式输入的第一行包含两个整数n和m,n是图的顶点数,m是边数。1以下m行,每行是一个数对v y,表示存在边(v,y)。顶点编号从1开始。输出格式单独一行
2015-01-09 00:41:42 404
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人