自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

原创 floyd(poj2240 arbitrage)

ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26618 Accepted: 11223DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency ...

2018-05-17 16:37:35 230

原创 floyd最短路径算法(poj3660 cow contest)

1、最短路径问题介绍问题解释: 从图中的某个顶点出发到达另外一个顶点的所经过的边的权重和最小的一条路径,称为最短路径解决问题的算法:迪杰斯特拉算法(Dijkstra算法)弗洛伊德算法(Floyd算法)SPFA算法之前已经对Dijkstra算法做了介绍(不懂的可以看这篇博客:Dijkstra算法详解),所以这篇博客打算对Floyd算法做详细的的介绍。2、Floyd算法的介绍算法的特点: 弗洛伊德算法...

2018-05-17 15:42:51 303

原创 dijkstra(poj1502 MPI Maelstrom )

MPI MaelstromTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11305 Accepted: 6966DescriptionBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distribu...

2018-05-16 21:05:45 206

原创 bellmanford(poj3259 wormholes)

WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 59980 Accepted: 22417DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole ...

2018-05-16 19:56:30 176

原创 最短路径算法—Bellman-Ford(poj1860 currency exchange)

Bellman-Ford算法详讲Dijkstra算法是处理单源最短路径的有效算法,但它局限于边的权值非负的情况,若图中出现权值为负的边,Dijkstra算法就会失效,求出的最短路径就可能是错的。这时候,就需要使用其他的算法来求解最短路径,Bellman-Ford算法就是其中最常用的一个。该算法由美国数学家理查德•贝尔曼(Richard Bellman, 动态规划的提出者)和小莱斯特•福特(Lest...

2018-05-15 19:23:55 274

原创 dijkstra(poj3268)

Language:DefaultSilver Cow PartyTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 27003 Accepted: 12341DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is goin...

2018-05-15 17:58:29 116

原创 最短路径—dijkstra算法(poj2387)

Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 68201 Accepted: 22898DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as pos...

2018-05-11 17:51:33 2157 1

原创 dfs(poj1321 棋盘问题)

棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 60858 Accepted: 29154Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输...

2018-05-10 20:42:35 136

原创 dfs(poj2488 a knight’s journey)

A Knight's JourneyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 49869 Accepted: 16929DescriptionBackground The knight is getting bored of seeing the same black and white squares again and ...

2018-05-10 19:32:17 363

原创 模拟+bfs(poj3083 children of the candy corn)

Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14932 Accepted: 6435DescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and ...

2018-05-10 18:27:20 148

原创 bfs迷宫(poj2251dungeon master)

Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 44624 Accepted: 16801DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed o...

2018-05-08 20:23:28 125

原创 bfs(poj1426 find the multiple)

Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 39336 Accepted: 16437 Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of...

2018-05-08 19:14:08 129

原创 bfs+素数打表(poj3126 prime path)

Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 25795 Accepted: 14207DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that...

2018-05-08 18:22:02 123

原创 bfs+模拟(poj3414 pots倒水问题)

PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21047 Accepted: 8976 Special JudgeDescriptionYou are given two pots, having the volume of A and B liters respectively. The following opera...

2018-05-08 17:12:06 197

原创 dfs+队列(poj3278 catch the cow)

Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 111204 Accepted: 34771DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediat...

2018-05-07 18:56:23 288

原创 动态规划+递归(poj1664 放苹果)

放苹果Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 36485 Accepted: 22473Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下...

2018-05-07 18:19:18 211

原创 hdu1172猜数字

猜数字Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6854    Accepted Submission(s): 3769Problem Description猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随...

2018-05-06 20:43:02 117

原创 dfs(hdu1175 连连看)

连连看Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 40217    Accepted Submission(s): 9926Problem Description“连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规...

2018-05-06 17:32:22 141

原创 空间点到直线的距离(hdu1174 爆头)

爆头Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2827    Accepted Submission(s): 1344Problem Descriptiongameboy是一个CS高手,他最喜欢的就是扮演警察,手持M4爆土匪的头。也许...

2018-05-06 16:13:04 1099

原创 经典bfs(poj1915)

Knight MovesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 28445 Accepted: 13373DescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move kn...

2018-05-06 16:10:50 172

原创 dfs+剪枝(poj1011Sticks)

SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 152214 Accepted: 36272DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units lon...

2018-05-06 10:00:29 142

原创 dfs+优先队列(poj2312)

Battle CityTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9482 Accepted: 3134DescriptionMany of us had played the game "Battle city" in our childhood, and some people (like me) even often p...

2018-05-05 11:50:36 312

原创 dfs(poj 1753 flip game)

Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 50222 Accepted: 21266DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares...

2018-05-04 20:51:01 137

原创 dfs

The GameTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11268 Accepted: 3469DescriptionOne morning, you wake up and think: "I am such a good programmer. Why not make some money?'' So you dec...

2018-05-04 18:59:18 172

原创 优先队列

Windows Message QueueProblem DescriptionMessage queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as ...

2018-05-03 19:45:58 85

原创 栈<stack>(括号匹配)

C. Replace To Make Regular Bracket Sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given string s consists of opening and closing b...

2018-05-03 19:03:35 1061

原创 栈stack<int>s(先进后出)

RailsDescriptionThere is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It w...

2018-05-03 18:10:23 3664

原创 stack栈(先进后出)

Train Problem ITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44538    Accepted Submission(s): 16688Problem DescriptionAs the new term comes, t...

2018-05-02 21:34:25 1963

原创 栈&amp;&amp;队列

1、stackstack 模板类的定义在&lt;stack&gt;头文件中。stack 模板类需要两个模板参数,一个是元素类型,一个容器类型,但只有元素类型是必要的,在不指定容器类型时,默认的容器类型为deque。定义stack 对象的示例代码如下:stack&lt;int&gt; s1;stack&lt;string&gt; s2;stack 的基本操作有:入栈,如例:s.push(x); 栈顶...

2018-05-02 20:46:13 99

空空如也

空空如也

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

TA关注的人

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