题目意思最开始看错了。。
Dij+DFS
//
// main.cpp
// test
//
// Created by Jacky Roth on 2019/2/22.
// Copyright © 2019 Jacky Roth. All rights reserved.
//
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn=505;
const int INF=0x3fffffff;
int M,N,start,des;
bool vis[maxn];
int dis[maxn];
int res[maxn];
int G[maxn][maxn];
vector<int>pre[maxn];
vector<int>temp_path,path;
void Dis(int index){
fill(dis, dis+maxn, INF);
dis[index]=0;
for (int i=0; i<N; i++) {
int u=-1,min=INF;
for (int j=0; j<N; j++) {
if (vis[j]==0&&dis[j]<