欢迎光临
我们一直在努力

PLCT检查是什么洛谷P4172 [WC2006]水管局长(lct求动态最小生成树)

#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define N 1100010
#define mp make_pair
#define lson ch[x][0]
#define rson ch[x][1]
#define pii pair<int,int>
using namespace std;

struct node
{
    int from,to,w;
} e[N];
struct o
{
    int from,to,kd,w,ori;
} op[N];
int n,m,k;
map<pii,int> m1,m2;

int cmp(node a,node b)
{
    return a.w<b.w;
}

//lct start

int f[N],ch[N][2],w[N],tag[N],sum[N];

int not_root(int now)
{
    int x=f[now];
    return lson==now||rson==now;
}

int push_up(int x)

    if(e[sum[rson]].w>e[sum[x]].w)
    {
        sum[x]=sum[rson];
    }
}

int rev(int x)
{
    swap(lson,rson);
    tag[x]^=1;
}

int push_down(int x)

}

int rotate(int x)

int push_all(int x)

    push_down(x);
}

int splay(int x)

        rotate(x);
    }
    push_up(x);
}

int access(int x)
{
    for(int y=0; x; y=x,x=f[x])
    {
        splay(x);
        rson=y;
        push_up(x);
    }
}

int make_root(int x)
{
    access(x);
    splay(x);
    rev(x);
}

int split(int x,int y)
{
    make_root(x);
    access(y);
    splay(y);
}

int find_root(int x)
{
    access(x);
    splay(x);
    while(lson)
    {
        push_down(x);
        x=lson;
    }
    return x;
}

int link(int x,int y)

int cut(int x,int y)

int print(int x)

//lct end

// dsu start

int fa[N];

int init()
{
    for(int i=1; i<N; i++)
    {
        fa[i]=i;
    }
}

int find(int x)

int unity(int x,int y)

//dsu end

int main()
{
    init();
    scanf("%d%d%d",&n,&m,&k);
    for(int i=1; i<=m; i++)
    {
        scanf("%d%d%d",&e[i].from,&e[i].to,&e[i].w);

    }
    sort(e+1,e+m+1,cmp);
    for(int i=1; i<=m; i++)
    {
        m2[mp(e[i].from,e[i].to)]=i;
        m2[mp(e[i].to,e[i].from)]=i;
    }
    int kd,from,to;
    for(int i=1; i<=k; i++)

    }
    for(int i=1; i<=m; i++)

    }
    stack<int> ans;
    for(int i=k; i>=1; i--)

        if(op[i].kd==2)

        }
    }
    while(!ans.empty())
    {
        printf("%d
",ans.top());
        ans.pop();
    }
}
赞(0)
未经允许不得转载:上海聚慕医疗器械有限公司 » PLCT检查是什么洛谷P4172 [WC2006]水管局长(lct求动态最小生成树)

登录

找回密码

注册