自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Jstyle的博客

做个骑士,以梦为马

  • 博客(59)
  • 收藏
  • 关注

转载 Dijkstra 算法

最短路径算法—Dijkstra(迪杰斯特拉)算法分析与实现(C/C++) Dijkstra(迪杰斯特拉)算法是典型的最短路径路由算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法能得出最短路径的最优解,但由于它遍历计算的节点很多,所以效率低。  Dijkstra算法是很有代表性的最短路算法,在很多专业课

2016-04-30 18:42:41 268

原创 POJ - 2387 Til the Cows Come Home(Dijkstra)

题目链接:http://poj.org/problem?id=2387#include #include #define MAX 0x3f3f3f3f#define N 2005using namespace std;/***********************************************************************************

2016-04-30 18:34:18 216

原创 HDU - 1874 畅通工程续(Dijkstra)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1874#include #include #define N 205#define MAX 100000005using namespace std;/*********************************************************************

2016-04-30 18:30:22 226

原创 HDU - 3790 最短路径问题(Dijkstra)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3790#include #include #include #define MAX 10000005#define N 1005using namespace std;/***********************************************************

2016-04-30 18:26:13 249

原创 HDU - 1548 A strange lift(Dijkstra)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1548#include #include #include #define MAX 0x3f3f3f3fusing namespace std;/************************************************************************

2016-04-30 18:23:21 200

原创 HDU - 2544 最短路(Dijkstra)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544#include #include #define MAX 10000005#define N 10005using namespace std;/********************************************************************

2016-04-30 18:19:36 248

原创 西电OJ - 1041 Franky的游戏O

题目链接:http://acm.xidian.edu.cn/problem.php?id=1041#include using namespace std;/****************************************************************************************************************

2016-04-27 22:28:35 1235

原创 西电OJ - 1042 另一个简单游戏

题目链接:http://acm.xidian.edu.cn/problem.php?id=1042#include #include #include #include using namespace std;/***************************************************************************************

2016-04-27 22:21:22 625

原创 西电OJ - 1035 数独

题目链接:http://acm.xidian.edu.cn/problem.php?id=1035#include #include using namespace std;/***********************************************************************************************************

2016-04-27 22:20:00 707

原创 USACO 2.1-Healthy Holsteins

题目链接:http://train.usaco.org/usacoprob2?a=ckp2K41VOuH&S=holstein/*ID: m1590291TASK: holsteinLANG: C++*/#include #include #include using namespace std;/***************************************

2016-04-25 17:35:56 203

原创 USACO 2.1-Sorting a Three-Valued Sequence

题目链接:http://train.usaco.org/usacoprob2?a=bzdILz0bsTb&S=sort3/*ID: m1590291TASK: sort3LANG: C++*/#include #include #include using namespace std;/*********************************************

2016-04-25 16:43:28 198

原创 HDU - 1501 Zipper

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1501#include #include using namespace std;/*********************************************************************************************************

2016-04-24 23:05:57 174

原创 UVA - 624 CD

题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=565#include #include using namespace std;/****************************************************

2016-04-24 23:05:01 554

原创 HDU - 2126 Buy the souvenirs

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2126#include #include #include using namespace std;/***********************************************************************************************

2016-04-23 23:29:02 243

原创 HDU - 2955 Robberies

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2955#include #include using namespace std;/*********************************************************************************************************

2016-04-23 23:27:35 197

原创 HDU - 2546 饭卡

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2546#include #include #include using namespace std;/***********************************************************************************************

2016-04-21 23:28:30 175

原创 HDU - 2602 Bone Collector

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602#include #include using namespace std;/*********************************************************************************************************

2016-04-21 23:24:00 176

原创 HDU - 1159 Common Subsequence

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1159#include #include using namespace std;/*********************************************************************************************************

2016-04-21 23:19:34 183

原创 HDU - 2571 命运

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2571#include #include #include using namespace std;/***********************************************************************************************

2016-04-20 23:07:32 192

原创 HDU - 1203 I NEED A OFFER!

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1203#include #include #include using namespace std;/***********************************************************************************************

2016-04-20 23:06:10 138

原创 HDU - 1087 Super Jumping! Jumping! Jumping!

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087#include using namespace std;/****************************************************************************************************************

2016-04-20 23:04:42 161

原创 HDU - 2084 数塔

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2084#include #include using namespace std;/*********************************************************************************************************

2016-04-20 22:14:17 205

原创 西电网络赛 - G

#include #include #include using namespace std;/**************************************************************************************************************** 画外音(学神满早上说用贪心,然后想了一天没想出

2016-04-17 21:55:26 340

原创 西电网络赛 - E

#include #include #include using namespace std;/**************************************************************************************************************** 题意: 给定两个串 s,s1,在s中

2016-04-17 21:52:56 241

原创 西电网络赛 - D

#include using namespace std;/**************************************************************************************************************** 水题,水过去********************************

2016-04-17 21:52:03 313

原创 西电网络赛 - C

#include using namespace std;/**************************************************************************************************************** 题意: 在主串中寻找子串出现的个数 思路:

2016-04-17 21:50:41 250

原创 西电网络赛 - B

#include #include using namespace std;/**************************************************************************************************************** 题意: 大致就是求 费波纳茨数列各项值以及求和

2016-04-17 21:50:04 273

原创 西电网络赛 - A

#include using namespace std;/****************************************************************************************************************** 思路:别用字符串读入,利用输入输出*******************

2016-04-17 21:49:22 446

原创 HDU - 1016 Prime Ring Problem

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1016#include #include using namespace std;/*********************************************************************************************************

2016-04-15 14:58:23 175

原创 HDU - 2553 N皇后问题

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553#include using namespace std;/***************************************************************************************************************

2016-04-14 22:50:41 230

原创 HDU - 1015 Safecracker

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1015#include #include #include #include #define res(v,w,x,y,z) v-w*w+x*x*x-y*y*y*y+z*z*z*z*zusing namespace std;/****************************

2016-04-14 22:37:25 171

原创 HDU - 1010 Tempter of the Bone

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010#include #include #include using namespace std;/***********************************************************************************************

2016-04-13 15:54:41 204

原创 BFS - 水题

#include #include #include using namespace std;/**************************************************************************************************************** 题意:S为起点,D为终点,X为墙壁,

2016-04-13 14:06:13 471

原创 cf - #346 C-Tanya and Toys

#include #include using namespace std;/******************************************************************************************************************* 贪心:排序,水过去

2016-04-12 23:46:20 246

原创 cf - #346 D-Bicycle Race

#include #define MAX 1010using namespace std;/******************************************************************************************************************** 最大的矩形四个顶点肯定不是危险;

2016-04-12 23:45:20 184

原创 cf - #346 E-New Reform

#include #include using namespace std;/**************************************************************************************************************** 题意: 给你一个图

2016-04-12 23:43:05 438

原创 cf- #346 A-Round House

#include using namespace std;/**************************************************************************************************************** 思路: 水题,注意数据正负和范围**********

2016-04-12 23:36:01 216

原创 USACO 2.1-The Castle

/*ID: m1590291TASK: castleLANG: C++*/#include #include #include using namespace std;/**********************************************************************************************************

2016-04-09 14:11:37 278

原创 借用一下界面

#include #include #include using namespace std;/***************************************************************************************************************** Question:

2016-04-08 13:41:45 187

原创 USACO 1.5-Superprime Rib

/*ID: m1590291TASK: sprimeLANG: C++*/#include #include using namespace std;/******************************************************************************************************************

2016-04-06 23:50:00 238

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除