# [置顶] 离散复习资料之一（Dijkstra算法）

Dijkstra算法。            Dijkstra算法，也可以叫做标记法。它的原理是把一个点的最短路径标记起来，并且把每一个到达他的最短路径的点标记起来。就像（5,4），就是表示到达它的最短的距离是4.它是通过5到达的，类似于递归的思想。 先来看一个最短路问题：           最开始，建图。           在你们输入的集合中，我们先要把关系图做出来。比如说就是集合A...

# E - Nightmare

Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial ...

# I - Substrings

You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.  ...

# Fair Division

Subject： It’syour friend’s birthday, and you and some other people decided to buy him a copyof StarCraft II, because who wouldn’t want to have that? Youagreed to divide the costs as fairly as poss...

# K - Supermarket

Mr. Jones is an exemplary husband. Every Saturday morning Mrs. Jones gives him a list of goods to be bought from the supermarket and he buys exactly what he has been asked for, always choosing the bra...

# A - 无向图最小生成树

N个点M条边的无向连通图，每条边有一个权值，求该图的最小生成树。 Input第1行：2个数N,M中间用空格分隔，N为点的数量，M为边的数量。（2 第2 - M + 1行：每行3个数S E W，分别表示M条边的2个顶点及权值。(1 Output输出最小生成树的所有边的权值之和。 Sample Input 9 14 1 2 4 2 3 8 3 4 7 4 5 9 5 6 10 6...

# A - Biorhythms

Subject Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and they have...

# D - Color Me Less

A color reduction is a mapping from a set of discrete colors to a smaller one. The solution to this problem requires that you perform just such a mapping in a standard twenty-four bit RGB color space....

# E - Round and Round We Go

Subject A cyclic number is an integer n digits in length which,when multiplied by any integer from 1 to n, yields a"cycle"of thedigits of the original number. That is, if you consider the number afte...

# Safecracker

Description The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in World...

# Y - Fibonacci Again

Subject There are another kind of Fibonacci numbers: F(0) = 7,F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).  *********************************************************************************************...

# A - Tempter of the Bone

Subject The doggie found a bone in an ancient maze, whichfascinated him a lot. However, when he picked it up, the maze began to shake,and the doggie could feel the ground sinking. He realized that th...

# G - 最少拦截系统

Subject 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.  怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,请帮助计算一下最...

64条 共5页1 2 3 4 5 ... 下一页 尾页
个人资料
• 访问：2303次
• 积分：573
• 等级：
• 排名：千里之外
• 原创：53篇
• 转载：10篇
• 译文：0篇
• 评论：0条
文章分类
文章存档