[题目链接] http://acm.hdu.edu.cn/showproblem.php?pid=6318 [算法] 线段树 / 树状数组 [代码] #include<bits/stdc++.h> using namespace std; #define MAXN 100010 long long i,n,x,y,len,ans,l,r,mid; long long a[MAXN],rk[MAXN],tmp[MAXN]; struct SegmentTree { struct Node { l…