思路:最短路是求到那些点的最短时间的,最短时间求出来,每个点的价值又是知道的,而且每个点可以拿无数次,就是完全背包问题了
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false)
#define endl '\n'
#define mk make_pair<int, int>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int N = 1e6 + 10;
const int inf = 0x3f3f3f3f;
int n, m, T;
int v[N];
struct node
{
int y, z, pre;
} edge[N];
int tot = 0;
int dist[N], head[N], vis[N];
ll dp[N];
void addedge(int x, int y, int z)
{
edge[++tot].y = y, edge[tot].z = z, edge[tot].pre = head[x], head[x] = tot;
}
void Dijstra()
{
memset(dist, inf, sizeof dist);
priority_queue<PII, vector<PII>, greater<PII> > heap;
dist[1] = 0;
heap.push(mk(0, 1));//first代表距离,secon