摘要: 大体思路就是枚举裁判位置,找逆序对数。练习一下用树状数组来寻找逆序对#include #include #include #define lowbit(x) ((x)&(-x))using namespace std;const int maxi = 100005;const int maxn = 20001;int C[maxi],num[maxn],n;int l[maxn],r[maxn];inline void add(int x,int d) { while(x 0) { ans += C[x]; x -= lowbit(x); } return ans;}int main( 阅读全文
posted @ 2014-01-21 15:28 acm_roll 阅读(325) 评论(0) 推荐(0) 编辑