>Link
luogu P2713
>Description
合并堆+删根
>解题思路
左偏树模板
>代码
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 1000010
using namespace std;
int n, m, val[N], dist[N], ls[N], rs[N], fa[N], root[N];
bool dead[N];
int find (int x)
{
if (root[x] == x) return x;
return root[x] = find (root[x]);
}
int merge (int A