上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页

2012年8月5日

SRM 551 DIV2

摘要: 昨天晚上网络太不给力了,一言难尽啊,泪奔啊 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cmath> 5 #include <map> 6 #include <algorithm> 7 using namespace std; 8 9 int judge[100]; 10 class ColorfulBricks { 11 public: 12 int countLayouts(string bricks) { 13 i 阅读全文

posted @ 2012-08-05 13:29 kakamilan 阅读(177) 评论(0) 推荐(0) 编辑

2012年8月4日

TSE中关于分词的算法的改写--最少切分

摘要: 今天比较闲,想到以前也看了好多tse的代码,还没有上手改过呢,一时也不知从何入手,后来在书上看到了分词的算法,TSE用的是正向最大匹配,其中貌似有个好玩的算法-----最少切分,捣鼓了一下午,终于把代码弄出来了。如果有人有兴趣的话,在HzSeg中修改SegmentSentenceMM函数的代码,将s2+=SegmentHzStrMM(dict, s1.substr(0,i));改成s2+=SegmentHzStr_min_cut(dict, s1.substr(0,i));就OK了。代码显得还是有些冗余,还是有优化的余地的,有时间再改吧。 1 string get_res(map<int 阅读全文

posted @ 2012-08-04 22:20 kakamilan 阅读(1485) 评论(0) 推荐(0) 编辑

全组和问题

摘要: 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <queue> 5 #include <algorithm> 6 #include <cstdio> 7 using namespace std; 8 9 #define MAX_N 1010 int n; //共n 个数11 int rcd[MAX_N]; // 记录每个位置填的数12 int num[MAX_N]; // 存放输入的n 个数13 int usd[MAX_N]; 阅读全文

posted @ 2012-08-04 13:54 kakamilan 阅读(125) 评论(0) 推荐(0) 编辑

全排列问题

摘要: 全排列 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <queue> 5 #include <algorithm> 6 #include <cstdio> 7 8 using namespace std; 9 #define MAX_N 1010 int n; //共n 个数11 int rcd[MAX_N]; //记录每个位置填的数12 int used[MAX_N]; //标记数是否用过13 int num[MAX_N] 阅读全文

posted @ 2012-08-04 13:18 kakamilan 阅读(134) 评论(0) 推荐(0) 编辑

2012年8月3日

memento模式

摘要: http://www.cnblogs.com/w0w0/archive/2012/05/21/2512153.htmlhttp://www.cnblogs.com/mayvar/archive/2011/09/08/wanghonghua_201109080336.html 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <map> 6 #include <list> 7 #inclu 阅读全文

posted @ 2012-08-03 16:03 kakamilan 阅读(124) 评论(0) 推荐(0) 编辑

Trie树的简单介绍和应用

摘要: 简单介绍http://www.cnblogs.com/cherish_yimi/archive/2009/10/12/1581666.html应用http://www.cnblogs.com/cherish_yimi/archive/2009/10/12/1581795.html 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <map> 6 #include <list> 7 #in 阅读全文

posted @ 2012-08-03 13:38 kakamilan 阅读(187) 评论(0) 推荐(0) 编辑

2012年8月2日

observe模式

摘要: 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <map> 6 #include <list> 7 #include <algorithm> 8 using namespace std; 9 typedef string State;10 11 class SecretaryBase;12 //抽象观察者13 class CObserverBase {14 protecte 阅读全文

posted @ 2012-08-02 16:29 kakamilan 阅读(414) 评论(0) 推荐(0) 编辑

2012年7月26日

state模式

摘要: http://www.cnblogs.com/graphicsme/archive/2011/12/09/2282657.htmlhttp://www.cnblogs.com/k-eckel/articles/204006.aspx 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <queue> 5 #include <set> 6 #include <algorithm> 7 #include <map> 8 # 阅读全文

posted @ 2012-07-26 22:01 kakamilan 阅读(243) 评论(0) 推荐(0) 编辑

strategy模式

摘要: 讲的很清楚http://www.cnblogs.com/graphicsme/archive/2011/12/03/2274918.html 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <queue> 5 #include <set> 6 #include <algorithm> 7 #include <map> 8 #include <stack> 9 using namespace std;10 阅读全文

posted @ 2012-07-26 21:09 kakamilan 阅读(197) 评论(0) 推荐(0) 编辑

2012年7月25日

template模式

摘要: 1 #include <iostream> 2 using namespace std; 3 class AbstractClass { 4 public: 5 AbstractClass() { 6 } 7 virtual ~AbstractClass() { 8 } 9 // 这个函数中定义了算法的轮廓10 void TemplateMethod();11 protected:12 // 纯虚函数,由派生类实现之13 virtual void PrimitiveOperation1() = 0;14 virtual void Pri... 阅读全文

posted @ 2012-07-25 23:55 kakamilan 阅读(159) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页

导航