参考:https://blog.csdn.net/wxh010910/article/details/55806735 以下课件,可并堆部分写的左偏树 #include<iostream> #include<cstdio> using namespace std; const int N=600005; int n,m,tot,fa[N],len[N],rt[N],d[N],cnt; long long p[N],sum; int read() { int r=0,f=1; cha…
A festival will be held in a town's main street. There are n sections in the main street. The sections are numbered 1 through n from left to right. The distance between each adjacent sections is 1. In the festival m fireworks will be launched. The i-…