楼兰图腾(树状数组 逆序对)
题目链接:https://www.acwing.com/problem/content/243/
树状数组可以直接求前边比他小的数和后边比他小的数
通过总的数减去比他小的数可以得到比他大的数
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int N=2e5+10;
int c[N],a[N];int n;
原创
2020-05-19 00:52:15 ·
154 阅读 ·
0 评论