摘要:
题目描述 The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. 阅读全文
摘要:
直接用Dijkstra做 用Dijkstra + dfs 这样做会更好理解 阅读全文
摘要:
#include using namespace std; const int N=1e3+100; int n,m,k,Ds; int mp[N][N]; int dis[N]; int vis[N]; int inf=0x3f3f3f3f; int toint(char s[]) { int sum=0; int len=strlen(s); for(int ... 阅读全文
摘要:
#include using namespace std; const int N=510; const int inf=0x3f3f3f3f; int mp[N][N]; bool vis[N]; int dis[N]; int n,m,s,D; int cost[N][N]; vectorpath[N]; void Dijkstra() { fill(vis,vis+N,fals... 阅读全文
摘要:
这题不能直接在Dijkstra中写这个第一 标尺和第二标尺的要求 因为这是需要完整路径以后才能计算的 所以写完后可以在遍历 阅读全文