
离散化
拔丝奶糖54
许我向你看,lllll
展开
-
树状数组求逆序对(逆序数)
逆序数(也叫逆序对) 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 【1】无重复的数 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #includ...原创 2018-07-25 22:41:43 · 3872 阅读 · 0 评论 -
离散化
【1】有重复数字,离散后重复数字相同 #include <cstdio> #include <algorithm> #include<cstring> #include<cmath> #include<iostream> using namespace std; const int maxn=1e5+5; int a[maxn], t[...原创 2018-07-26 09:49:37 · 146 阅读 · 0 评论