版本比较
题解:P10193 [USACO24FEB] Bessla Motors G
正文
增加 7 行删除 7 行
37 行未改动383940414242434445464748495051515253545522 行未改动7879808182828384858645 行未改动1321331341351361361371381391405 行未改动14614714814915015015115215315415515615715815916016116016116216337 行未改动 } void push(int x) { a[++cnt1]=x; up(cnt1); up(cnt1); } void pop() { swap(a[cnt1],a[1]); cnt1--; down(1); } bool empty(){return cnt1==0;} int front(){return a[1];} int front(){return a[1];} }q; inline void add(int u,int v,int w1) { nxt[++cnt]=hd[u];22 行未改动 { if(cs[to[i]]==0) { cs[to[i]]=1; ans[to[i]]++; ans[to[i]]++; } } else continue; q.push(to[i]);45 行未改动 scanf("%d%d%d",&a1,&a2,&a3); add(a1,a2,a3); add(a2,a1,a3); } if(c<=10000) //嘿嘿,精髓卡时 if(c<=10000) //嘿嘿,精髓卡时 { for(int i=1;i<=c;i++) dij(i); for(int i=c+1;i<=n;i++) {5 行未改动 printf("%d",ans1); for(int i=1;i<=ans1;i++) { printf("\n%d",ans2[i]); } } } else { for(int i=c+1;i<=n;i++) dij2(i); printf("%d",ans1); for(int i=1;i<=ans1;i++) { printf("\n%d",ans2[i]); } } }
} ```