View Code 需要离散化,但用map就方便多了了#include<stdio.h>#include<string.h>#include<map>using namespace std;const int maxn = 10010;int rank[maxn],p[maxn];int n,m;void init(){ int i; for(i=0;i<=10000;i++) { p[i]=i; rank[i]=0; }}int find(int x){ if(p[x]==x) return x; int tx=fi... Read More