![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模板
zryabc
while(1){
}
展开
-
【日常加速】手打堆
自己用结构体封装了一个堆。 支持插入,删除,判断是否为空,取出堆顶元素的操作 struct Heap { int A[20005];//线性表容器 int len;//长度 bool empty() {//判断是否为空 return len==0; } void Down(int p) {//Down操作 in...原创 2018-05-02 13:56:30 · 240 阅读 · 0 评论 -
【原创】最小生成树 并查集
不说了#include<bits/stdc++.h> using namespace std; struct edge{ int from; int to; int cost; }G[200005]; int n,m,cnt=0,ans=0,ct=0; int p[5005]; int find(int x){return p[x]==x?x:p[x]=find(p[x]);} ...原创 2018-04-29 19:12:26 · 133 阅读 · 0 评论