关闭
当前搜索:

Dijkstra算法详解

算法简介 用于计算从一个顶点到其余各顶点的最短路径算法 适用于权值为非负的图的单源最短路径,用斐波那契堆的复杂度O(E+VlgV) 主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止 算法思想这里我们以这组例子为列1 4 1 4 2 3 4 3 1 3 2 1在这里我们使用数组vis数组来标记未走过的节点以dis数组来存储从 1 到 到 1 2...
阅读(2136) 评论(0)

Floyd算法详解

简介 : Floyd算法是解决任意两点间的最短路径的一种算法 Floyd算法是一个经典的动态规划算法 Floyd算法的时间复杂度为O(N3),空间复杂度为O(N2) 算法描述与原理:首先我们的目标是寻找从点i到点j的最短路径。从一个节点 i 到 节点 j,无非就是两种情况 直接从 i 点 到 j 点 如 i 点出发经过若干个点到达 j 点 要找出最 i...
阅读(1833) 评论(0)

HDU 1087

Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now....
阅读(942) 评论(0)

POJ 2533

Description A numeric sequence of ai is ordered if a1 < a2 < … < aN. Let the subsequence of the given numeric sequence ( a1, a2, …, aN) be any sequence ( ai1, ai2, …, aiK), where 1 <= i1 < i2 < … < iK...
阅读(1023) 评论(0)

POJ 2081

Description The Recaman’s sequence is defined by a0 = 0 ; for m > 0, a m = a m−1 − m if the rsulting a m is positive and not already in the sequence, otherwise a m = a m−1 + m. The first few numbers...
阅读(168) 评论(0)

POJ 1159

Description A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the...
阅读(150) 评论(0)

POJ 1579

水题!Description We all love recursion! Don’t we?Consider a three-parameter recursive function w(a, b, c):if a <= 0 or b <= 0 or c 20 or b > 20 or c > 20, then w(...
阅读(163) 评论(0)

POJ 1163

初入dp,第一道dp题Description7 3 8 8 1 0 2 7 4 4 4 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that...
阅读(212) 评论(0)

CodeForces - 557A Ilya and Diplomas

Ilya and Diplomas Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription 不久以后,一场信息学奥林匹克竞赛将在BERLAND举行,很多学生都要参加。赛事组委会决定,每一名参赛的选手都可以获得奖励,分别是一等奖或者二等奖或者...
阅读(339) 评论(0)

POJ 1017

Description A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square parc...
阅读(193) 评论(0)

HDU 5210

Description WLD likes playing with numbers. One day he is playing with NN integers. He wants to delete KK integers from them. He likes diversity, so he wants to keep the kinds of different integers as...
阅读(176) 评论(0)

POJ 1862

Stripies Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14292 Accepted: 6707Description Our chemical biologists have invented a new very useful form of life called stripies (...
阅读(418) 评论(1)

POJ 3069

DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops....
阅读(505) 评论(4)
    个人资料
    • 访问:112737次
    • 积分:1390
    • 等级:
    • 排名:千里之外
    • 原创:41篇
    • 转载:3篇
    • 译文:0篇
    • 评论:32条
    博客专栏
    最新评论