
分治
Orion233
这个作者很懒,什么都没留下…
展开
-
“推恩令”——分治法
A-01 POJ1854A palindrome is a string of symbols that is equal to itself when reversed. Given an input string, not necessarily a palindrome, compute the number of swaps necessary to transform the stri原创 2017-03-16 22:07:10 · 398 阅读 · 0 评论 -
分治法 or BIT 求逆序对
方法1: 求逆序对可以利用归并排序来求,其实就是分治。 归并排序在排序过程很中对于一样的数比较是不会改变次序的,因而可以用来求逆序对。 代码如下: 1 #include<stdio.h> 2 3 void Merge(int ,int ,int ); 4 void mergeSort(int ,int ); 5 6 int ch[20000],temp[20000]; 7 in原创 2017-04-25 20:19:38 · 555 阅读 · 0 评论