先算出一个点前头比它大和后头比它小的数量. 每次删点就扔进一个主席树里头,防止造成重复删答案. #include <iostream> #include <cstring> #include <cstdio> using namespace std; int n, m, a[100005], p[100005], c[100005], uu, pre[100005], suf[100005]; int lson[5000005], rson[5000005], sum[…
/* Dear friend, wanna learn CDQ? As a surprice, this code is totally wrong. You may ask, then why you put it on your blog, are you fucking crazy with the fans, isn't it clear you do not have one. Well, I just found a anime picture in other's blog. I…