摘要: http://www.cppblog.com/shyli/archive/2007/04/06/21366.htmlstl中的优先队列的模板:#include priority_queue q;(队头为大,top为大)这是按照从大到小的队列;priority_queue, greater > q;这是从小到大的优先队列;#include struct cmp { bool operator ()(const int &i,const int &j) { return i>j; } }; http://acm.sdut.edu.cn/sdutoj/pro... 阅读全文
posted @ 2012-07-20 16:56 _雨 阅读(401) 评论(6) 推荐(0)
摘要: http://www.matrix67.com/blog/archives/115上面的文章虽然讲的很详细 不过还是没看太懂看 了下面的公式和讲解 思想明了简单KMP练习http://poj.org/problem?id=3461View Code 1 #include<stdio.h> 2 #include<string.h> 3 char w[10001],p[1000001]; 4 int next[10001]; 5 long num; 6 void fnext(char *c1) 7 { 8 int i,j,k1; 9 k1 = strlen(c1);10 . 阅读全文
posted @ 2012-07-20 13:17 _雨 阅读(328) 评论(0) 推荐(0)