摘要: 题意:就是让你求两个字符串的最大子串 阅读全文
posted @ 2018-01-26 18:46 啦啦啦天啦噜 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题意:原本都是1,然后区间更新,最后求值 (ps:这个题卡了2 3个月,主要还是没有理解之前的线段树,后来又忘了,今日虽然过了,但仍有些地方没有想通) 阅读全文
posted @ 2018-01-20 22:00 啦啦啦天啦噜 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 拓扑排序模板:总算手动写了一下,感谢cf (ps:下次学习带队列优化的) 阅读全文
posted @ 2018-01-14 22:13 啦啦啦天啦噜 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 虽然在刷kuangbin的dp基础,但看到这道题的时候还是用贪心过掉了(虽然第一次写的vector套vector没有成功,最后还是用数组过掉了) 看了dp 的理解以后想了想才知道,一个数列的最长上升字序列其实就是这个数列的不下降序列的个数,因为上升就是不下降的意思 最后附上贪心代码 阅读全文
posted @ 2018-01-13 00:01 啦啦啦天啦噜 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 阶乘 hdu1042 hdu 1047 hud 1063 高精度小数包括去除前导零和末尾零的方法 BigInteger POW用法 y.compareTo(BigInteger.TEN.pow(30))<=0 阅读全文
posted @ 2018-01-01 15:01 啦啦啦天啦噜 阅读(255) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; const int maxn=1e4+7; int n,m,cot,sum; struct edge { int u,v,w; bool operator <(const edge &b)const{ return w<b.w; } }g[maxn]; int f[maxn]; int Find... 阅读全文
posted @ 2017-12-31 18:48 啦啦啦天啦噜 阅读(141) 评论(0) 推荐(0) 编辑
摘要: manacher(马拉车)算法可以在O(n)中求出最长回文子串 算法原理主要是在匹配的时候使用了一个id和mx,以及用回文串对称的性质,这样在On复杂度内算出来的,前面的常数好像不是很大 hdu 3068 manacher算法模板题 阅读全文
posted @ 2017-12-30 21:56 啦啦啦天啦噜 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 字典树模板题,没有用链式存储,用的数组(提交一直re,都没发现是数组类型写错了,不如自己写一遍) 阅读全文
posted @ 2017-12-27 13:15 啦啦啦天啦噜 阅读(130) 评论(0) 推荐(0) 编辑
摘要: ///链表 #include <bits/stdc++.h> using namespace std; typedef struct aa { int date; struct aa *next; } sq,*List; void tailcreat(List &l,int n)//尾插 { int 阅读全文
posted @ 2017-12-21 23:15 啦啦啦天啦噜 阅读(525) 评论(0) 推荐(0) 编辑
摘要: LL ex_gcd(LL a,LL b,LL &x,LL &y) { if(b==0){ x=1;y=0; return a; } LL r=ex_gcd(b,a%b,y,x); y-=x*(a/b); return r; } 阅读全文
posted @ 2017-12-10 13:26 啦啦啦天啦噜 阅读(122) 评论(0) 推荐(0) 编辑