<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[JoyForce的专栏]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/JoyForce</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; JoyForce]]></copyright><item><title><![CDATA[C#若干关键字解析 (abstract, interface, sealed, virtual, override, new, delegate)]]></title><link>https://blog.csdn.net/JoyForce/article/details/45418761</link><guid>https://blog.csdn.net/JoyForce/article/details/45418761</guid><author>JoyForce</author><pubDate>Fri, 01 May 2015 13:32:45 +0800</pubDate><description><![CDATA[abstract:

1. 不能实例化，只能通过子类实例化
2. abstract方法只能在abstract类中，abstract类被继承时，子类必须实现所有abstract方法

interface:
1. 全部方法不能有实体，没有修饰符
2. 除方法，属性，索引器和事件外，不能有其他类型的成员
virtual方法可以有函数体，但abstract没有
override和new都]]></description><category></category></item><item><title><![CDATA[C# 正则表达式 笔记]]></title><link>https://blog.csdn.net/JoyForce/article/details/9419187</link><guid>https://blog.csdn.net/JoyForce/article/details/9419187</guid><author>JoyForce</author><pubDate>Tue, 23 Jul 2013 10:47:24 +0800</pubDate><description><![CDATA[1. 双引号匹配：\'''不起作用，要用\"
待续]]></description><category></category></item><item><title><![CDATA[C#中的正则表达式]]></title><link>https://blog.csdn.net/JoyForce/article/details/9399943</link><guid>https://blog.csdn.net/JoyForce/article/details/9399943</guid><author>JoyForce</author><pubDate>Sun, 21 Jul 2013 19:15:46 +0800</pubDate><description><![CDATA[输出匹配的部分：
public static void Main(string[] args)
        {           
            string text = "I've found this amazing URL at http://www.sohu.com ,and then find ftp://ftp.sohu.com is better.";]]></description><category></category></item><item><title><![CDATA[POJ 1065 (贪心法)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8692656</link><guid>https://blog.csdn.net/JoyForce/article/details/8692656</guid><author>JoyForce</author><pubDate>Tue, 19 Mar 2013 17:03:18 +0800</pubDate><description><![CDATA[/*
思路：首先对木棒排序，按length升序排序，length相同，则按weight升序排序
然后在weight中通过贪心法找有多少个递增序列
*/
#include 
#include 
using namespace std;

const int MAX_NUM = 5002;
struct stick{
	int len, wgt;
}stk[MAX_NUM];
bool vis[MAX]]></description><category></category></item><item><title><![CDATA[POJ 1141 (动态规划)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8656865</link><guid>https://blog.csdn.net/JoyForce/article/details/8656865</guid><author>JoyForce</author><pubDate>Sun, 10 Mar 2013 20:48:40 +0800</pubDate><description><![CDATA[先看一种容易理解的方法，不过会超时
#include 
#include 
#include 
using namespace std;

char str[101];
string lbr = "(";
string rbr = ")";
string lsbr = "[";
string rsbr = "]";
//char res[201];

const int INF = 999999]]></description><category></category></item><item><title><![CDATA[POJ 1743 (后缀数组)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8611325</link><guid>https://blog.csdn.net/JoyForce/article/details/8611325</guid><author>JoyForce</author><pubDate>Mon, 25 Feb 2013 21:41:35 +0800</pubDate><description><![CDATA[思路：
首先构建后缀数组，这里要注意theme可以相差k，如abcdefgh中，d-a == e-b因此可以将原数组相邻元素做差，s[i] = s[i] - s[i+1]，这样就转化为大小为n-1的数组建立后缀树组。
然后利用二分法搜索可能的长度，判断该长度是不是无重叠重复子串的长度。对于每一个长度d，将height中大于等于d的保留，小于的去除，这样就将height分为几组，因为求最大重复子]]></description><category></category></item><item><title><![CDATA[POJ 3264 (RMQ)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8600425</link><guid>https://blog.csdn.net/JoyForce/article/details/8600425</guid><author>JoyForce</author><pubDate>Thu, 21 Feb 2013 21:39:03 +0800</pubDate><description><![CDATA[RMQ简介 ：http://blog.csdn.net/niushuai666/article/details/6624672
//思路使用RMQ算法，分别计算某个区间上的最小值和最大值，做差即可
#include 
#include 
using namespace std;

const int MAX_NUM = 200001;
int fmax[MAX_NUM][20], fmin[MA]]></description><category></category></item><item><title><![CDATA[POJ 2352 (树状数组)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8591289</link><guid>https://blog.csdn.net/JoyForce/article/details/8591289</guid><author>JoyForce</author><pubDate>Tue, 19 Feb 2013 15:23:05 +0800</pubDate><description><![CDATA[//计算某颗星的level，就是计算所有x,y都小于该星的星星数目
//由于输入数据是按y递增的，因此只要计算当前时刻x坐标位于(0, x)的星星数目即可
//计算某一区间上数据的和用树状数组(且区间上数据是动态变化的)
//树状数组:http://blog.sina.com.cn/s/blog_8627bf080100sq46.html
#include 
using namespace std]]></description><category></category></item><item><title><![CDATA[POJ 2777 (线段树)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8589528</link><guid>https://blog.csdn.net/JoyForce/article/details/8589528</guid><author>JoyForce</author><pubDate>Tue, 19 Feb 2013 00:34:37 +0800</pubDate><description><![CDATA[//关键点：
//1. 用位代表颜色，计算某个段的颜色组成时，用或运算:
//   line[c].color = line[c<<1].color | line[(c<<1)+1].color
//2. 延时着色，即当某一层为纯色时，则将它的子节点都标记为该颜色
#include 
using namespace std;

struct node{
	int from, to;
	//每一位代]]></description><category></category></item><item><title><![CDATA[poj 2828 (线段树)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8586248</link><guid>https://blog.csdn.net/JoyForce/article/details/8586248</guid><author>JoyForce</author><pubDate>Sun, 17 Feb 2013 21:21:18 +0800</pubDate><description><![CDATA[//思路：从最后一个人往前插，这样pos的意义就变成了，前面有多少个空位。
//线段树上每个节点中存储的是当前时刻，该区间有多少空位。
//如果某个人插入到pos[i]，则找第pos[i]个空位置插入即可
#include 
using namespace std;

struct node{
	int from, to;
	int cap;
};

const int MAX_NUM = 200]]></description><category></category></item><item><title><![CDATA[POJ 2002 (hash + 几何)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8580273</link><guid>https://blog.csdn.net/JoyForce/article/details/8580273</guid><author>JoyForce</author><pubDate>Wed, 13 Feb 2013 22:10:47 +0800</pubDate><description><![CDATA[算法过程：

1 将顶点按x坐标递增排序，若x相同，按y坐标递增排序，然后枚举所有边，对每一条由点p1和p2(根据排序p1 

    1) 将边绕p1逆时针旋转90度得到点p3

    2) 将边绕p2顺时针旋转90度得到点p4

则p1 p2 p3 p4组成一个正方形，设p1 = (x1,y1), p2 = (x2, y2)，根据向量的旋转公式可以求出p3, p4的坐标为]]></description><category></category></item><item><title><![CDATA[POJ 1258 (最小生成树 kruskal)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8577665</link><guid>https://blog.csdn.net/JoyForce/article/details/8577665</guid><author>JoyForce</author><pubDate>Sat, 09 Feb 2013 16:40:53 +0800</pubDate><description><![CDATA[克鲁斯卡尔（Kruskal）算法（只与边相关）




算法描述：克鲁斯卡尔算法需要对图的边进行访问，所以克鲁斯卡尔算法的时间复杂度只和边又关系，可以证明其时间复杂度为O（eloge）。

算法过程：

1.将图各边按照权值进行排序

2.将图遍历一次，找出权值最小的边，（条件：此次找出的边不能和已加入最小生成树集合的边构成环），若符合条件，则加入最小生成树的集合中。不符合条]]></description><category></category></item><item><title><![CDATA[POJ 1789 (最小生成树 prim)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8577637</link><guid>https://blog.csdn.net/JoyForce/article/details/8577637</guid><author>JoyForce</author><pubDate>Sat, 09 Feb 2013 15:30:51 +0800</pubDate><description><![CDATA[Prim算法：

    Prim算法实现的是找出一个有权重连通图中的最小生成树，即：具有最小权重且连接到所有结点的树。(强调的是树，树是没有回路的)。

    Prim算法是这样来做的： 

    首先以一个结点作为最小生成树的初始结点，然后以迭代的方式找出与最小生成树中各结点权重最小边，并加入到最小生成树中。加入之后如果产生回路则跳过这条边，选择下一个结点。当所有结点都加入到最]]></description><category></category></item><item><title><![CDATA[POJ 2230 (欧拉回路)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8574763</link><guid>https://blog.csdn.net/JoyForce/article/details/8574763</guid><author>JoyForce</author><pubDate>Wed, 06 Feb 2013 20:52:55 +0800</pubDate><description><![CDATA[//给你一幅连通的图，要求从起点1开始走，要经过每条边刚好两次，
//并且最终回到1起点，很明显，欧拉回路，dfs输出路径即可。
/*
//邻接矩阵表示法，超时
#include 
using namespace std;

const int VETEX_NUM = 10002;
const int EDGE_NUM = 50002;
int adj[VETEX_NUM][VETEX_NUM];]]></description><category></category></item><item><title><![CDATA[POJ 1386 (欧拉路径+并查集)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8574745</link><guid>https://blog.csdn.net/JoyForce/article/details/8574745</guid><author>JoyForce</author><pubDate>Wed, 06 Feb 2013 20:42:20 +0800</pubDate><description><![CDATA[题目的大意是：给出一些单词，问能否拼接成一串，使单词字母首尾相连。
例如，Sample中的：
acm
malform
mouse
我们可以构造出：
acm->malform->mouse，符合题目要求。
/*
1. 有向图G为欧拉图，当且仅当G的基图 连通，且所有顶点的入度等于出度。
2. 有向图G为半欧拉图，当且仅当G的基图连通，且存在一个顶点的入度比出度大1，
   一个顶点入度]]></description><category></category></item><item><title><![CDATA[POJ 1042(枚举+贪心)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8571473</link><guid>https://blog.csdn.net/JoyForce/article/details/8571473</guid><author>JoyForce</author><pubDate>Tue, 05 Feb 2013 13:40:02 +0800</pubDate><description><![CDATA[#include 
using namespace std;

const int MAX_NUM = 32;
const int MAX_MINUTE = 20 * 12;
int d[MAX_NUM], t[MAX_NUM], time[MAX_NUM], tt[MAX_NUM];
int f[MAX_NUM][MAX_MINUTE];
int n, h;

int max(int a, in]]></description><category></category></item><item><title><![CDATA[POJ 1033 (模拟+贪心)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8526960</link><guid>https://blog.csdn.net/JoyForce/article/details/8526960</guid><author>JoyForce</author><pubDate>Tue, 22 Jan 2013 01:02:21 +0800</pubDate><description><![CDATA[思路参考的一篇博文，写的很清楚：http://www.cnblogs.com/damacheng/archive/2010/09/24/1833983.html
我对他的代码做了优化，用数组实现了堆栈

#include 
using namespace std;

const int MAX_NUM = 10002;
int cluster[MAX_NUM];
int stack[MAX_]]></description><category></category></item><item><title><![CDATA[POJ 1011 (DFS+剪枝)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8524607</link><guid>https://blog.csdn.net/JoyForce/article/details/8524607</guid><author>JoyForce</author><pubDate>Mon, 21 Jan 2013 14:05:31 +0800</pubDate><description><![CDATA[/*
思路：
首先说说暴力搜索的思路，先将数组排序，然后从第一个开始遍历，找和为target的组合
找到一组后，再从头开始找另一组，直到全部匹配为止
剪枝策略：
1. target肯定介于最大值和sum之间
2. target肯定能被sum整除
3. 排序后可能有相邻两个数相等的情况，如果前一个不符合条件，那么当前的就不用再执行递归了
*/
#include 
#include 
using na]]></description><category></category></item><item><title><![CDATA[POJ 2531 (DFS+剪枝)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8520762</link><guid>https://blog.csdn.net/JoyForce/article/details/8520762</guid><author>JoyForce</author><pubDate>Sat, 19 Jan 2013 20:29:28 +0800</pubDate><description><![CDATA[剪枝策略：
初始设置所有节点都归于集合A，如果将某元素由集合A移动到集合B，流量会减小，则剪枝
因为在递归过程中，集合A中元素越来越多，diff值是单调递减的，因此当diff为负时，后续的sum只会减小

#include 
using namespace std;

const int MAX_NUM = 24;
const int A = 0;
const int B = 1;
int]]></description><category></category></item><item><title><![CDATA[POJ 2251(BFS)]]></title><link>https://blog.csdn.net/JoyForce/article/details/8519859</link><guid>https://blog.csdn.net/JoyForce/article/details/8519859</guid><author>JoyForce</author><pubDate>Sat, 19 Jan 2013 12:37:11 +0800</pubDate><description><![CDATA[看练习册上把这道题归到DFS，于是用了DFS，TLE，于是换用BFS，一次AC

#include 
#include 
using namespace std;

const int MAX_LEN = 32;
const int INF = 0x3F3F3F3F;
char maze[MAX_LEN][MAX_LEN][MAX_LEN];
bool vis[MAX_LEN][MAX_LEN]]></description><category></category></item></channel></rss>