
分治+归并
文章平均质量分 76
cloudy_happy
像我这样优秀的人,不该平凡过一生
展开
-
51nod1019 逆序数 分治+归并
逆序数 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。 Input 第1行:N,N为序列的长度(n <= 50000) 第2 - N + 1行:序列中的元素(0 <= Aii...原创 2018-08-03 21:43:26 · 164 阅读 · 0 评论 -
poj2299Ultra-QuickSort 分治归并
Ultra-QuickSort In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the ...原创 2018-08-03 21:47:59 · 139 阅读 · 0 评论 -
codeforces 559B Equivalent Strings 分治归并
Equivalent Strings Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are called equivalent in one of the two cases: They ...原创 2018-08-05 09:08:41 · 191 阅读 · 0 评论