ACM: 图论题+记忆DP poj 2662 (边…
来源:互联网 发布:网络安全工程师年薪 编辑:程序博客网 时间:2024/05/16 01:08
The forest is beautiful, and Jimmy wants to take a different routeeveryday. He also wants to get home before dark, so he always takesa path to make progress towards his house. He considers taking apath from A to B to be progress if there exists a route from B tohis home that is shorter than any possible route from A. Calculatehow many different routes through the forest Jimmy mighttake.
Input
Output
Sample Input
5 6
1 3 2
1 4 2
3 4 3
1 5 12
4 2 34
5 2 24
7 8
1 3 1
1 4 1
3 7 1
7 4 1
7 5 1
6 7 1
5 2 1
6 2 1
0
Sample Output
2
4
题意: 从A到B, 并且B到达终点最短路径小于A到终点的最短路径.要你求出一共存在多少条B开始的这样的路径.
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
#define MAX 1005
const int INF = 2147483647;
struct node
{
}edges[MAX*2];
int n, m;
int first[MAX];
bool g[MAX][MAX], vis[MAX];
int dist[MAX];
int dp[MAX];
int num;
void addedge(int u,int v,int w)
{
}
void read_graph()
{
}
void spfa(int start)
{
}
int solve(int v)
{
}
int main()
{
//
}
- ACM: 图论题+记忆DP poj 2662 (边…
- ACM: 图论题 poj 2240 (floyd + ST…
- ACM: 图论题 poj 3…
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1…
- ACM: 匈牙利算法 图论题 poj 3041 …
- ACM: 差分约束 图论题 poj 2983 sp…
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 图论题 poj 2253 (poj上的dou…
- ACM: polay定理 数论题 poj 1286 …
- ACM: 图论题 poj 1135
- ACM: 二分图最佳匹配 图论题 poj 3…
- ACM: 二分图最大匹配 图论题 poj 2…
- ACM: 图论题 poj 1161 (把图重建成…
- ACM: 图论题 poj 1789 (一次AC的水…
- ACM: 图论题 poj 1125 (题意读好久…
- ACM: 图论题 poj 1062 (邻接矩阵+d…
- ACM: 最小费用最大流 图论题 poj 2…
- ACM: 动态规划 poj 1014
- ACM: 二分图最佳匹配 图论题 poj 3…
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 二分图最大匹配 图论题 poj 2…
- Largest prime 尤拉托斯展那筛选法
- ACM: 图论题+记忆DP poj 2662 (边…
- 进程与线程区别
- ACM: 最大流问题 图论题 poj 2263
- ACM: 简单动态规划题 poj 2955
- 第一章 答疑摘选
- ACM: 树状DP 动态规划题 poj 1463 …
- 华为测试题图片排序(简单的冒泡排序)
- ACM: 贪心法 poj 1700
- ACM: 博弈题 poj 1067