03 2020 档案

摘要:快补题别再摸鱼了(17/34) 1.AC自动机 #define maxnode 1000010 #define maxsize 26 struct ahocT{ int ch[maxnode][maxsize]; int e[maxnode],fail[maxnode]; int sz; void 阅读全文
posted @ 2020-03-30 12:37 MukoiAoi 阅读(211) 评论(0) 推荐(0)
摘要:(29/29) 3.23已完成 1.KMP int Next[maxn]; void prekmp(char* x,int len){ int pre=-1,suf=0; Next[0]=-1; while(suf<len){ while(pre!=-1&&x[suf]!=x[pre]) pre=N 阅读全文
posted @ 2020-03-24 23:27 MukoiAoi 阅读(314) 评论(0) 推荐(1)
摘要:CF 1285D Trie+贪心 一点通2.3的变体,第一眼看成原题。。。 01trie上贪心 很裸的题 进阶版2.3例题里面有一堆。。。。不过当年做的加强版是这样的(可持久化Trie+贪心) //#define LOCAL #include <cstring> #include <iostream 阅读全文
posted @ 2020-03-22 15:41 MukoiAoi 阅读(147) 评论(0) 推荐(0)
摘要:CodeForces:527C 558E/URAL 1989 线段树 阅读全文
posted @ 2020-03-21 19:16 MukoiAoi 阅读(127) 评论(0) 推荐(0)
摘要:E题 uva 12338 求两串的最长公共前缀 因为T很小其实可以裸上exkmp,然而现场写炸了qaq exkmp的板子+ac代码 void pre_EKMP(char x[],int m,int next[]){ next[0]=m; int j=0; while(j+1<m&&x[j]==x[j 阅读全文
posted @ 2020-03-17 21:07 MukoiAoi
摘要:1 void doit(){ 2 //字符串采用快速读入 从1开始 3 pre=0; 4 Next[0]=0;Next[1]=0;//起点标记 5 FOR(suf,2,lenx){ 6 while(pre>0&&x[suf]!=x[pre+1]) pre=Next[pre]; //递推求最大公共前后 阅读全文
posted @ 2020-03-10 15:09 MukoiAoi 阅读(92) 评论(0) 推荐(0)