两道差分约束(最短路)POJ 3159 Candies POJ 3196 Layout

During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag o...

2018-01-21 10:27:44

阅读数:55

评论数:0

一道题搞定所有最短路写法

http://acm.hdu.edu.cn/showproblem.php?pid=1874 题目大意: 给你一些点,让你求S到T的最短路径。 我只是来练习一下SPFA的 dijkstra+邻接矩阵 [cpp] view plain copy #i...

2018-01-20 14:23:27

阅读数:125

评论数:0

POJ 1511 Invitation Cards(优先队列优化后的迪杰斯特拉)

In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagat...

2018-01-19 13:48:11

阅读数:95

评论数:0

POJ 3259 Wormholes (贝尔曼算法判断负环) POJ 1860 Currency Exchange (判断正环) HDU 1217(贝尔曼判断正环)

While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path th...

2018-01-19 13:22:14

阅读数:60

评论数:0

最短路算法详解(Dijkstra/SPFA/Floyd)

转自:http://blog.csdn.net/murmured/article/details/19281031 一、Dijkstra Dijkstra单源最短路算法,即计算从起点出发到每个点的最短路。所以Dijkstra常常作为其他算法的预处理。  使用邻接矩阵的时间复杂...

2018-01-16 19:30:33

阅读数:47

评论数:0

PAT 1003 Emergency(最短路(迪杰斯特拉||贝尔曼)最小边权下的最大点权)

1003. Emergency (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an eme...

2018-01-15 23:17:38

阅读数:131

评论数:0

POJ 3660 Cow Contest(最短路弗洛伊德预处理或者迪杰斯克拉)

N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each...

2018-01-13 13:22:34

阅读数:88

评论数:0

POJ 3268 Silver Cow Party (最短路,置换矩阵)

One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A tot...

2018-01-11 21:37:56

阅读数:95

评论数:0

51nod n^n的末位数字(快速幂||找循环节)

给出一个整数N,输出N^N(N的N次方)的十进制表示的末位数字。Input 一个数N(1 <= N <= 10^9) Output 输出N^N的末位数字 Sample Input 13Sample Output 3方法很多:快速幂可以,找循环节也可以。快...

2018-01-11 12:58:27

阅读数:52

评论数:0

51 nod 1013 3的幂的和(乘法逆元)

求:3^0 + 3^1 +...+ 3^(N) mod 1000000007 Input 输入一个数N(0 <= N <= 10^9) Output 输出:计算结果 Sample Input 3Sample Output 40直接暴力是会超时的,得用到等...

2018-01-11 11:23:09

阅读数:47

评论数:0

并查集三道入门题

题目描述 Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You h...

2018-01-09 21:39:10

阅读数:145

评论数:0

POJ 2263 Frogger(最大值的最小值) POJ 1797 Heavy Transportation (最小值的最大值)

Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but...

2018-01-07 15:44:58

阅读数:73

评论数:0

POJ 2387 Til the Cows Come Home(最短路 迪杰斯特拉)

Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. B...

2018-01-06 20:39:30

阅读数:76

评论数:0

UVA 11624(图广搜)

题目链接:点击打开链接Joe works in a maze. Unfortunately, portions of the maze havecaught on fire, and the owner of the maze neglected to create a fireescape plan...

2018-01-02 20:22:34

阅读数:81

评论数:0

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