题目链接:http://poj.org/problem?id=1724
题意:
共1~N城市,从城市1出发到城市N,给出R条路,每条路有长度有花费,起始资金K,
求到达城市N的最短路程,不能达到则输出-1
剪枝,否则TLE.
// ROADS -- POJ 1724
#include<iostream>
#include<cstdio>
#include<cmath>
#include<queue>
#include<vector>
#include<string>
#include<cstring>
#include<stack>
#include<algorithm>
using namespace std;
typedef long long ll;
#define maxn 1000000
int n,m,x,y,ans=0;
struct Road
{
int d,l,t;
};
int dx[5]={
0,0,1,-1