摘要: /* Kruskal */ #include using namespace std; const int N = 200001; const int M = 500001; struct Node{ int u,v; int val; }A[M]; int n,m,p,cnt,cost,fa[N]; bool cmp(Node a, Node b){ ... 阅读全文
posted @ 2019-05-18 07:12 探险家_H 阅读(180) 评论(0) 推荐(0)
摘要: 欧拉函数积性: 当 a | b 时 : φ(ab) = a * φ(b); (a整除b) 当 a⊥b 时 : φ(ab) = φ(a) * φ(b); (a与b互质) 阅读全文
posted @ 2019-05-18 06:54 探险家_H 阅读(201) 评论(0) 推荐(0)
摘要: #include #define re register using namespace std; const int N(100001); const int M(200001); const int INF(0x7fffffff); struct f1{ int v; int w; int nxt; }e[M]; int n,m,s,cnt; int head... 阅读全文
posted @ 2019-05-18 06:41 探险家_H 阅读(290) 评论(0) 推荐(0)
摘要: #include #define N 200001 #define M 500001 #define pr pair #define mk make_pair using namespace std; const int INF = 0x7fffffff; struct Node{ int v,val,nxt; }e[M]; int n,m,s,top; int dist[N]... 阅读全文
posted @ 2019-05-18 06:39 探险家_H 阅读(230) 评论(0) 推荐(0)