摘要:
别忘了路径压缩。#include#include#include#define MAXN 300000using namespace std;int n,m;int fa[MAXN];int fnd(int x){ if(x!=fa[x]) return fa[... 阅读全文
摘要:
克鲁斯卡尔 很好的一个处理方式是 间接排序也就是通过在另一个数组排序号,保留原始数据。#include#include#include#define MAXN 200000using namespace std;int m,n,ans;int u[MAXN],v[MA... 阅读全文
摘要:
Following OrdersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5289 Accepted: 2160DescriptionOrder is an important... 阅读全文