对于数组s[0~n-1],计算next[0~n](多计算一位)。
考虑next[n],假设t=n-next[n],如果n%t==0,则t就是问题的解,否则解为1。
这样考虑:
比如字符串"abababab",
a b a b a b a b *
next -1 0 1 2 3 4 5 6 7
考虑这样的模式匹配,将"ababa...
分类:
其他好文 时间:
2014-08-04 21:38:08
阅读次数:
294
A method for operating a memory module device. The method can include transferring a chip select, command, and address information from a host memory ...
分类:
其他好文 时间:
2014-08-04 20:38:38
阅读次数:
386
1:去除 GridView 头上的 "Drag a column header here to group by that column"--> 点击 Run Designer -> 找到:OptionView ->将 ShowGroupPanel : 设置为 false ;2:如何 显示出 Gri...
分类:
其他好文 时间:
2014-08-02 23:24:04
阅读次数:
350
UVA 10298 - Power Strings
题目链接
题意:本意其实就是,给定一个字符串,求出最小循环节需要几次循环出原字符串
思路:利用KMP中next数组的性质,n - next[n]就是最小循环节,然后n / 循环节就是答案
代码:
#include
#include
const int N = 1000005;
char str[N];
int ...
分类:
其他好文 时间:
2014-08-02 18:21:43
阅读次数:
282
求fibonacci数列前N个数的K次方和。通项公式:F[n]=((1+sqrt(5))/sqrt(5)-(1-sqrt(5))/sqrt(5))/sqrt(5)。有点乱,不过由于可以保证最后的结果是一个整数,所有所有的根号都可以化为整数进行取模和逆元运算。首先解二次同余方程,X^2=n (mod ...
分类:
其他好文 时间:
2014-08-02 15:19:53
阅读次数:
294
点击打开链接
多源多汇最大流,虚拟一个源点s'和一个汇点t',原来的源点、汇点向它们连边。
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 500 + 5;
const int INF = 100000000;
struct Ed...
分类:
Web程序 时间:
2014-08-01 23:13:32
阅读次数:
312
sharepoint 2010用designer添加自定义的 display form默认是不会显示附件的。需要添加如下代码才会显示附件:Attachment
分类:
其他好文 时间:
2014-08-01 13:12:41
阅读次数:
156
atitit.web ui 结构建模工具总结
1. 王者.dreamweaver 1
2. Frontpage/SharePoint Designer(FrontPage) 2010... 1
3. Netbeans6.5 1
4. Ms vs 1
5. Xara Web Designer..雅十专业级的ide 1
6. Adobe GoLive(好像不更新了) 2
...
分类:
Web程序 时间:
2014-08-01 00:03:30
阅读次数:
235
在做AMlogic项目的时候,配置按键后,发现电源键只能关机,不能开机,很是郁闷
后来发现是漏掉了一个地方没有配置,firmware/arc_power/irremote2arc.c 这个文件里面没有正确的配置好
1、#define IR_POWER_KEY 0xe51afb04 这个值需要配置成电源键的全码值,也就是用串口获取到的键值
2、unsigned int kk[] = { ...
分类:
其他好文 时间:
2014-07-31 20:56:37
阅读次数:
195
题目链接:http://poj.org/problem?id=3233解题报告:输入一个边长为n的矩阵A,然后输入一个k,要你求A + A^2 + A^3 + A^4 + A^5.......A^k,然后结果的每个元素A[i][j] % m。(n 2 #include 3 #include ...
分类:
其他好文 时间:
2014-07-31 20:43:37
阅读次数:
229