自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 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 213

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

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

2018-05-17 15:42:51 283

原创 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 192

原创 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 160

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

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

2018-05-15 19:23:55 260

原创 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 107

原创 最短路径—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 2132 1

原创 dfs(poj1321 棋盘问题)

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

2018-05-10 20:42:35 123

原创 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 344

原创 模拟+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 137

原创 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 113

原创 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 119

原创 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 113

原创 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 184

原创 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 278

原创 动态规划+递归(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 199

原创 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 105

原创 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 132

原创 空间点到直线的距离(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 1071

原创 经典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 161

原创 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 135

原创 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 292

原创 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 122

原创 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 160

原创 优先队列

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 77

原创 栈<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 1048

原创 栈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 3632

原创 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 1936

原创 栈&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 87

原创 田忌赛马(贪心)

Tian Ji -- The Horse RacingTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34248    Accepted Submission(s): 10372Problem DescriptionHere is a fa...

2018-04-28 20:04:23 198

原创 动态规划(多个状态同时dp)

A. Vacationstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has n days of vacations! So he decided to improve his IT skills and do sport. Vas...

2018-04-28 18:47:18 910

原创 far relative‘s proplem(区间模拟)

B. Far Relative’s Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFamil Door wants to celebrate his birthday with his friends from Far Far ...

2018-04-28 17:27:48 157

原创 最大不能组合数和不能组合数的个数

A New Change ProblemTime Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1609    Accepted Submission(s): 1023Problem DescriptionNow given two kinds o...

2018-04-28 16:40:32 689 1

原创 贪心(区间覆盖)

Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 101412 Accepted: 22561DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in t...

2018-04-27 20:55:05 272

原创 区间覆盖

TIANKENG’s restaurantTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 3344    Accepted Submission(s): 1251Problem DescriptionTIANKENG manages a ...

2018-04-27 19:46:48 183

原创 贪心算法

Doing Homework againTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16565    Accepted Submission(s): 9651Problem DescriptionIgnatius has just co...

2018-04-27 19:08:54 99

原创 sort对结构体排序

用sort对结构体进行排序步骤如下1.先写c++头文件# include&lt;iostream&gt;# include&lt;algorithm&gt; //这个是sort的头文件 using namespace std; 2.定义一个结构体eg:struct node{int x;int y;}a[105];3.写定义函数 (以下为从小到大排列用&lt;,若从大到小用&gt;) bool c...

2018-04-24 21:22:24 17034 2

原创 去重函数unique

Bear and Three Ballstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is a little polar bear. He has n balls, the i-th ball has size ti.Limak ...

2018-04-24 19:44:03 394

原创 前m大的数(打表标记)

前m大的数Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22462    Accepted Submission(s): 7609Problem Description还记得Gardon给小希布置的那个作业么?(上次比赛的1005)其实小...

2018-04-24 18:31:47 86

原创 8皇后问题(离线打表)

題目網址中文網址#include&lt;iostream&gt;using namespace std;int P[1000][9];//方式i中第j行皇后的列位置为P[i][j] int tmp[8];//当前方式中第i行皇后的列位置为tmp[i] int n=0;//方式数初始化 bool col[8]={0},leftt[15]={0},rightt[15]={0};//所有列和左...

2018-04-24 17:46:46 307

空空如也

空空如也

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

TA关注的人

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