krustral算法加并查集,按题给要求维护并查集~ #include<bits/stdc++.h> using namespace std; ; const int inf=1e9; int N,M,x,y; int c,w; struct edge { int u; int v; int w; }Edge[maxn*]; int mst[maxn]; int num[maxn]; int father[maxn]; bool cmp (edge a,edge b) { return a.w…
原题连接:https://pta.patest.cn/pta/test/16/exam/4/question/677 题目如下: The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT. Input Specification: Each…