codeforces 540 E. Infinite Inversions (分类思想+线段树求逆序对)Sep 20, 2016·1442 words·3 minsACM 线段树 逆序对题目链接 题意:一个无穷数列,从1开始,初始第i个位置上为i,给出n个swap,每次交换两个位置的数。问交换 n 次以后得到的数列中,逆序对的个数。
codeforces 220 E. Little Elephant and Inversions (树状数组+尺取)Sep 15, 2016·918 words·2 minsACM 双指针 树状数组 逆序对题目链接 题意: how many pairs of integers l and r are there, such that 1 ≤ l < r ≤ n and sequence b = _a_1_a_2… a__l__a__r__a__r + 1… a__n has no more than k inversions.
codeforces 61 E. Enemy is weak (离散化+线段树求逆序三元组)Sep 5, 2016·638 words·2 minsACM 离散化 线段树 逆序对题目链接 题意:给出n个数,求满足 i<j<k且a[i]>a[j]>a[k]的三元组有多少个。
codeforces 459 D. Pashmak and Parmida's problem (离散化+线段树求逆序对数)Sep 5, 2016·800 words·2 minsACM 线段树 逆序对题目链接 题意:定义_f_(l, r, x)为区间[l,r]中x出现的次数。现在要求calculate the number of pairs of indicies i, j (1 ≤ i < j ≤ n) such that_f_(1, i, a__i) > f(j, n, a__j).
hdu 1394 Minimum Inversion Number (树状数组 逆序对)Oct 28, 2015·415 words·1 minACM 树状数组 逆序对# 题目链接 题意: 这题是问一个长度为n的循环数组中,逆序对最少的个数。。。