东海道专题

集美大学“第15届蓝桥杯大赛(软件类)“校内选拔赛 H卯酉东海道

dijk + spfa思想 然后你需要存一下每个点 * l种颜色,你开个数组存一下 st[i][j] 为到达i点且到达以后是j颜色的最小距离是否已经确定了 #include<bits/stdc++.h>using namespace std;using ll = long long;const int N = 3e5+10;struct Edge{ll to,col,w;b