题目
分治
第一眼 : 二维树状数组。。我还没写过。。。而且w挺大的。。。反正这是cdq题,按我就按cdq写好了。
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#define en '\n'
#define m(a,b) memset(a,b,sizeof a)
#define low(i) ((i)&(-i))
using namespace std;
typedef long long ll;
const int M=1e5+6e4+5,Q=1e4+5,W=2e6+5;
const ll mod=1e9+7;
template<class T>void rd(T &x)
{
x=0;int f=0;char ch=getchar();
while(ch<'0'||ch>'9') {
f|=(ch=='-');ch=getchar();}
while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
x