RMQ模板
摘要:RMQ动态规划的思想int a[1100];int dp[maxn][20];void rmq_init(){ for(int i=0;i<n;i++) dp[i][0]=a[i]; for(int j=1;(1<<j)<=n;j++) for(int i=0...
阅读全文
posted @
2015-09-13 20:10
Beserious
阅读(171)
推荐(0) 编辑
HDU 5443 The Water Problem
摘要:The Water ProblemTime Limit: 1500/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 153Accepted Submission(s): 123P...
阅读全文
posted @
2015-09-13 20:08
Beserious
阅读(179)
推荐(0) 编辑
HDU 5438 Ponds
摘要:PondsTime Limit: 1500/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 282Accepted Submission(s): 86Problem Descri...
阅读全文
posted @
2015-09-13 19:32
Beserious
阅读(141)
推荐(0) 编辑
HDU 5441 Travel
摘要:Travel Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 94 Accepted Submission(s): 32 Problem De
阅读全文
posted @
2015-09-13 16:44
Beserious
阅读(198)
推荐(0) 编辑
AC自动机模板
摘要:struct ACauto{ int ch[maxn][26]; int sz; int f[maxn],last[maxn],val[maxn],cnt[maxn]; void init(){ sz=1; memset(ch[0],0,sizeo...
阅读全文
posted @
2015-09-03 18:36
Beserious
阅读(209)
推荐(0) 编辑
KMP 模板
摘要:#include#include#include#include#include#define maxn 10000using namespace std;int f[maxn];void getfail(char *p,int *f){ int m=strlen(p); f[0]=0;...
阅读全文
posted @
2015-09-03 15:23
Beserious
阅读(269)
推荐(0) 编辑
HDU 2746 Cyclic Nacklace
摘要:Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4420Accepted Submission(s): 2011Pro...
阅读全文
posted @
2015-09-03 15:02
Beserious
阅读(215)
推荐(0) 编辑