摘要: #include <stdio.h> #include <stdlib.h> int n,m; int father[1000],rank[1000]; int count; int find(int x) { if(father[x]==x) return x; else return fathe 阅读全文
posted @ 2018-11-08 20:30 北梗 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 在遍历加油站的时候,会将经过的x加油站放入优先队列,之后将x从数组中删掉,即用最后一个加油站来替代x;这时如果不 “i--”,则会漏掉检查原来的stop[n-1],则可能造成错误。 阅读全文
posted @ 2018-11-08 10:35 北梗 阅读(98) 评论(0) 推荐(0) 编辑