摘要: 昨天晚上又看到牛客网买华为云的优惠了,第一次看见的时候没放在心上,再次看见进去了解了一下发现最终算下来1C2G一年只要9元!就果断入手了。 很早以前就听说了华为云,第一次买云服务器的时候就去了解过,但是当时价格比较贵而且也没有学生优惠就没有考虑。现在看来该有的慢慢都有了。 用途有很多,可以在搭建个人 阅读全文
posted @ 2019-11-23 22:33 />.<\ 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 题意:给出一个字符串,字符串的每个字符是1阶回文,若字符串的某个长度为t的子串回文,这个子串的回文阶数是同起点开头长度为⌊t/2⌋的串的回文阶数加1。现在要求统计所有回文阶数对应包含的子串数量 区间DP:以d[l][r]记录ch[l]~ch[r]的子串的回文阶数。如果ch[l~r]回文,d[l][r 阅读全文
posted @ 2017-08-03 20:08 />.<\ 阅读(180) 评论(0) 推荐(0) 编辑
摘要: K路求和归并: 两路归并过程: 1.将两个序列升序排列。 2.将一个序列B的首与另外一个序列A的每一个元素求和,加入到一个优先队列中。 3.依次取优先队列队头,查找队头来自B的哪一个位置,将现在和中的B[n]替换为B[n 1] 时间复杂度O(N logN) K路归并则进行K 1次两路归并 如果数组长 阅读全文
posted @ 2017-07-31 21:43 />.<\ 阅读(327) 评论(0) 推荐(0) 编辑
摘要: ``` #include #include #include #include #include using namespace std; bool vis[10]; string ch; int len; void dfs(int k, string s) { if(k == 0){ cout>ch){ memset(vis, 0, size... 阅读全文
posted @ 2017-07-26 21:54 />.<\ 阅读(76) 评论(0) 推荐(0) 编辑
摘要: ``` include include include include using namespace std; string gg[10][10]; int g[10][10][2]; bool vis[10][10]; struct st { int x, y; int state; //0:( 阅读全文
posted @ 2017-07-24 21:29 />.<\ 阅读(225) 评论(0) 推荐(0) 编辑
摘要: ``` include include include include include include include include include using namespace std; const int maxn = 200000 + 10; char s[maxn]; int sa[ma 阅读全文
posted @ 2017-07-21 22:31 />.<\ 阅读(136) 评论(0) 推荐(0) 编辑
摘要: ``` include include include include include include include include using namespace std; const int maxn = 10000 + 10; char s[maxn]; int sa[maxn], t[ma 阅读全文
posted @ 2017-07-20 20:30 />.<\ 阅读(226) 评论(0) 推荐(0) 编辑
摘要: ``` include include include include include include include include using namespace std; const int maxn = 1000 + 10; int s[100 maxn]; int sa[100 maxn] 阅读全文
posted @ 2017-07-20 20:24 />.<\ 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 题意:公司里有员工,员工的上司,员工上司的上司...给一个人分配工作,他的直接员工和间接员工都会停下手中的工作一起去做的他的工作,问指定的一个人现在在做的工作。 dfs时间戳处理出每一个人对应的工作时间范围,类比成某个人管辖的区间。dfs序已经将每个人编号,所以区间的最左侧即为这个人自己。然后就将区 阅读全文
posted @ 2017-07-20 20:16 />.<\ 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题意:给出一个字符串,要求从中分别找出一个前缀、中缀、后缀,使得他们相等。找出满足要求的长度最大的子串,否则输出Just a legend KMP+Hash。KMP的next数组的本质为模式串的当前位置前缀中,最长匹配的前后缀数量。 那么就枚举串中每一个位置,通过next数组可以得到一个前缀和一个中 阅读全文
posted @ 2017-07-17 22:47 />.<\ 阅读(273) 评论(0) 推荐(1) 编辑