<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[wode的专栏]]></title><description><![CDATA[当我们为一去不复返的青春叹息时，我们应该考虑将来的衰老，不要到那时再为没有珍惜壮年而悔恨。]]></description><link>https://blog.csdn.net/sunbaofeng2</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; sunbaofeng2]]></copyright><item><title><![CDATA[如何定义和实现一个类的成员函数为回调函数(转)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/22894543</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/22894543</guid><author>sunbaofeng2</author><pubDate>Thu, 03 Apr 2014 20:42:47 +0800</pubDate><description><![CDATA[如果试图直接使用C++的成员函数作为回调函数将发生错误，甚至编译就不能通过。通过查询资料发现，其错误是普通的C++成员函数都隐含了一个传递函数作为参数，亦即“this”指针，C++通过传递this指针给其成员函数从而实现程序函数可以访问C++的数据成员。这也可以理解为什么C++类的多个实例可以共享成员函数却-有不同的数据成员。由于this指针的作用，使得将一个CALL-BACK型的成员函数作为回调]]></description><category></category></item><item><title><![CDATA[双堆求中位数]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/22696013</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/22696013</guid><author>sunbaofeng2</author><pubDate>Mon, 31 Mar 2014 22:14:04 +0800</pubDate><description><![CDATA[求数组中位数的方法：

1、排序

2、双堆

3、findk

效率分别是nlog(n)、nlog(n)、log(n)

用堆维护中位数的意思是说，设计两个堆，第一个堆存放小于中位数的元素，第二个堆存放大于中位数的元素。

下面是双堆维护中位数的语言描述：

1、初始化的时候设置两个变量分别记录两个堆【左堆和右堆】的元素的个数

2、取第一个元素【d[0]】作为初]]></description><category></category></item><item><title><![CDATA[hdu4713	 Permutation(集合类型的dp,难-不拿手！！！)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/11661859</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/11661859</guid><author>sunbaofeng2</author><pubDate>Fri, 13 Sep 2013 21:58:58 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define tree int o,int l,int r
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define lo o<<1
#d]]></description><category></category></item><item><title><![CDATA[hdu 4725 (spfa（deque）+建图（建图很难）) 求最短路]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/11656115</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/11656115</guid><author>sunbaofeng2</author><pubDate>Fri, 13 Sep 2013 17:47:03 +0800</pubDate><description><![CDATA[//spfa方法+deque优化
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define tree int o,int l,int r
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#]]></description><category></category></item><item><title><![CDATA[hdu4699	 Editor(数据结构+思路)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/11396051</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/11396051</guid><author>sunbaofeng2</author><pubDate>Sun, 08 Sep 2013 21:25:42 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define tree int o,int l,int r
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define l]]></description><category></category></item><item><title><![CDATA[hdu4686 Arc of Dream ——构造矩阵+快速幂]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/10156753</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/10156753</guid><author>sunbaofeng2</author><pubDate>Wed, 21 Aug 2013 17:44:39 +0800</pubDate><description><![CDATA[矩阵构造：
一个矩阵全是常量，另一个是a[i]的，求a[i+1]的!
构造矩阵如下：
Ai*bi        AX*BX    AX*BY   AY*BX    AY*BY      0      a(i-1)*b(i-1)
Ai            0       AX       0       AY         0      a(i-1)
Bi            0     ]]></description><category></category></item><item><title><![CDATA[HDU 4691(后缀数组+lcp)水题]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/10122463</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/10122463</guid><author>sunbaofeng2</author><pubDate>Tue, 20 Aug 2013 20:06:51 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
#define inf 0x7fffffff
#define exp 1e-9
#define N 100009
using namespace std;
in]]></description><category></category></item><item><title><![CDATA[hdu4666（曼哈顿距离+set或multiset）]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9953425</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9953425</guid><author>sunbaofeng2</author><pubDate>Tue, 13 Aug 2013 19:45:45 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define tree int o,int l,int r
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define l]]></description><category></category></item><item><title><![CDATA[Hdu 4658拆分数(难懂啊！)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9935737</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9935737</guid><author>sunbaofeng2</author><pubDate>Mon, 12 Aug 2013 21:49:09 +0800</pubDate><description><![CDATA[Hdu 4658 要求拆分的数中每个数出现的次数不能大于等于k次，则






已经求得，现在看Q(x^k)会怎么样



例如，当n=8，k=4时

满足指数为8的乘积之和为：

所以将8拆分的数中每个数的个数小于4的有16个，分别为

8,1+7,1+1+6,1+1+1+5,6+2,1+5+2,1+1+4+2,1+1+1+3+2,4+2+2,1+3+2+2,]]></description><category></category></item><item><title><![CDATA[HDU - 3775(几何+Pick定理+好题)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9934581</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9934581</guid><author>sunbaofeng2</author><pubDate>Mon, 12 Aug 2013 20:22:42 +0800</pubDate><description><![CDATA[Pick定理,Pick 定理是这样的， S=a+ b/2 - 1 ，其中 S是图形面积， a 是图形内部格点数， b 是边经过的格点数，适用范围是：顶点坐标均是整点，或者说顶点在格点上的简单多边形。

面积怎么求？三角形的叉乘。



这题很让人郁闷的是，图中的顶点并不是用 pick定理求出的顶点，而还要再加上外面那一圈，也就是还要加上 b

//sum为内部的有向面积的两倍]]></description><category></category></item><item><title><![CDATA[分拆数 && hdu 4651 && hdu 4658]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9917403</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9917403</guid><author>sunbaofeng2</author><pubDate>Mon, 12 Aug 2013 10:07:28 +0800</pubDate><description><![CDATA[分拆数




在将分拆数之前先介绍一点五边形数



http://en.wikipedia.org/wiki/Pentagonal_number 










1. 五边形数是能排成五边形的多边形数。 

第n个五边形数公式：p(n)=(3*n^2-n)/2

前几个五边形数：1, 5, 12, 22, 35, 51, 70, 92, 1]]></description><category></category></item><item><title><![CDATA[hdu（4655-打表找规律）]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9916295</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9916295</guid><author>sunbaofeng2</author><pubDate>Mon, 12 Aug 2013 09:25:23 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define tree int o,int l,int r
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define l]]></description><category></category></item><item><title><![CDATA[hdu4651(定理题-水)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9904641</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9904641</guid><author>sunbaofeng2</author><pubDate>Sun, 11 Aug 2013 21:16:25 +0800</pubDate><description><![CDATA[欧拉函数的倒数是分割函数的母函数，亦即：

的生成函数是


   （1）

再

利用五边形数定理可得到以下的展开式：



 （2）

将（2）式带入（1）式，并乘到（1）式的左边，进行展开，合并同类项，根据非常数项的系数为0！！


即将生成函数配合五边形数定理，可以得到以下的递归关系式



#include
#include
#include]]></description><category></category></item><item><title><![CDATA[hdu4630（树状数组+离线处理）]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9707465</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9707465</guid><author>sunbaofeng2</author><pubDate>Thu, 01 Aug 2013 20:28:47 +0800</pubDate><description><![CDATA[http://www.cnblogs.com/kuangbin/archive/2013/07/30/3225627.html
题意：给出一个n和1到n的某个排列，询问q次，每次询问[l,r]区间内任意挑两个数，最大公约数的最大值是多少。

#include
#include
#include
#include
#include
#include
#include
#include
#inc]]></description><category></category></item><item><title><![CDATA[URAL 1105（WA中……搞不定啊！！）]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/9672691</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/9672691</guid><author>sunbaofeng2</author><pubDate>Wed, 31 Jul 2013 20:53:49 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define tree int o,int l,int r
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define l]]></description><category></category></item><item><title><![CDATA[HDU 4345（想不出来的DP）]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/8945282</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/8945282</guid><author>sunbaofeng2</author><pubDate>Sat, 18 May 2013 21:47:25 +0800</pubDate><description><![CDATA[题目链接：http://acm.hdu.edu.cn/showproblem.php?pid=4345

题目大意：求长度为n的数列的置换的循环节的长度的种数。

题目思路：以下摘自题解：
   循环节的长度为各独立置换环长度的最小公倍数。问题即求相加和为N的正整数的最小公倍数的可能数。
由于1不影响最小公倍数，问题转化为相加小于等于N的若干正整数的最小公倍数的可能数。
如果这些正整数包]]></description><category></category></item><item><title><![CDATA[poj 1465]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/8891616</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/8891616</guid><author>sunbaofeng2</author><pubDate>Mon, 06 May 2013 17:38:45 +0800</pubDate><description><![CDATA[题意是： 给出一个 0 - 4999 的数 N  ，在给出 M 个0-9的数，判断这M个数字能不能构成一个数是N的倍数，如果有输出最小的，如果没有输出0。
此题用BFS 。。 这个题好在 用 余数判重剪枝。。 



BFS  如果不加以剪枝，一定会搜索的情况会很庞大。所以应该用余数判重 。

   为什么可以用余数判重？

       A=a*N +e 即A%N =e]]></description><category></category></item><item><title><![CDATA[四边形不等式优化dp-简介]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/8877176</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/8877176</guid><author>sunbaofeng2</author><pubDate>Thu, 02 May 2013 18:35:39 +0800</pubDate><description><![CDATA[最有代价用d[i,j]表示 
d[i,j]=min{d[i,k-1]+d[k+1,j]}+w[i,j] 
其中w[i,j]=sum[i,j] 
四边形不等式   
     w[a,c]+w[b,d]
决策单调性 
     w[i,j]


于是有以下三个定理 


定理一： 如果w同时满足四边形不等式 和 决策单调性 ,则d也满足四边形不等式
定理二：当定理一的条件满]]></description><category></category></item><item><title><![CDATA[ZOJ 3327(思路题)]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/8798395</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/8798395</guid><author>sunbaofeng2</author><pubDate>Sat, 13 Apr 2013 22:30:16 +0800</pubDate><description><![CDATA[题解：
给定一个很大的数，求一个比其大，且各位上的数的积相等。
情况：
 如果数字当中有0，故单独判断，只要将其最后一位+1，但当有且仅有一个0且0在最后一位，我们得特殊处理，不然最后一位+1，把0给去掉了，故从倒数第二位开始。
其他情况，从低位向高位遍历，记录2,3,5,7的个数，对于每个位，看是否可以用已经有的2,3,5,7的个数构成大于此数的最小数，如果存在这个数字，那么可以停止遍历]]></description><category></category></item><item><title><![CDATA[SDUT 2411——Pixel density模拟细节WA了n遍]]></title><link>https://blog.csdn.net/sunbaofeng2/article/details/8783611</link><guid>https://blog.csdn.net/sunbaofeng2/article/details/8783611</guid><author>sunbaofeng2</author><pubDate>Wed, 10 Apr 2013 16:22:15 +0800</pubDate><description><![CDATA[网址：http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2411
山东省第三届ACM省赛的题。

注意点：

1、小数点可以没有，用小数点和星号做分隔符的可以省省了。

2、空格没说几个，用getline()相当麻烦，不如手动输入字符串数组。

3、inches不是唯一分隔符，手机名称中可]]></description><category></category></item></channel></rss>