上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页
摘要: 题目大意: 给你一些单词,和一个字符串,问你这个字符串中含有多少个上面的单词。 解题分析: 这是多模匹配问题,如果用KMP的话,对每一个单词,都跑一遍KMP,那么当单词数量非常多的时候,耗时会非常多,所以这里用到了AC自动机,这是一种类似于Trie树的数据结构,但是同时,它也用到了KMP算法中 ne 阅读全文
posted @ 2018-08-19 23:52 Draymonder 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Tree Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1741 Description Give a tree with n vertices,each edge has a length(positi 阅读全文
posted @ 2018-08-18 18:13 Draymonder 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目让O(1)预处理出来 类三角形边界及内部的和 根据这个图 就是一个大矩形-左边的绿色的矩形 - 蓝色的大三角形 + 右上角突出的蓝色的小三角形 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define r 阅读全文
posted @ 2018-08-18 16:05 Draymonder 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 小zc现在有三个字符串,他想知道前两个字符串能不能生成第三个字符串,生成规则如下:第一个串的每个字符都可以往第二个串的任意位置插入(包括首尾位置),但必须保证来源于第一个串中的字符在生成后的串中的相对顺序不可以改变。 举个例子: String A: cu String B: mt 那么,A和B可以生 阅读全文
posted @ 2018-08-18 11:22 Draymonder 阅读(271) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int N = 2000000+10; struct node{ node *next[26]; int num; bool ok; node() { for(int i=0;i<26;i++) { 阅读全文
posted @ 2018-08-18 11:19 Draymonder 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 首先下载mac版本的 sublimetext3 下载链接: https://www.sublimetext.com/3 接着可以按照其他博客的方法来安装一些插件,便于我们的工作和学习 安装sublime text 3 插件 1.安装 Package Control组件: 按 control+` (键 阅读全文
posted @ 2018-08-16 16:35 Draymonder 阅读(1753) 评论(0) 推荐(0) 编辑
摘要: 重点补充一下 dp 和 字符串的营养,其他的一些 交给队友好了 下面是很棒的一些视频讲解 电子科大ACM视频 https://space.bilibili.com/7711573/#/video 浙师大ACM视频 https://space.bilibili.com/8198319/#/video 阅读全文
posted @ 2018-08-14 23:06 Draymonder 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 直接Copy好了 // 欧拉函数 phi(n) = n * π(1-1/p) ,p为n的质因数 // phi(m*n) = phi(m) * phi(n),nm互质 // phi(i*p) = p*phi(i) ,当i mod p == 0 const int N = 3e6+5; bool vis 阅读全文
posted @ 2018-08-14 22:31 Draymonder 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 根据公式就是 对每次C(n,m) = C(n%p,m%p) * C(n/p,m/p); ll pow(ll x,ll n) { ll res = 1; x%=mod; while (n) { if(n&1) res = res*x%mod; x = x*x %mod; n >>=1; } retur 阅读全文
posted @ 2018-08-14 22:29 Draymonder 阅读(1031) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1348 给一个半径和n个点 求圆的周长 + n个点的凸包的周长 #include<bits/stdc++.h> using namespace std; const int maxn = 1005; co 阅读全文
posted @ 2018-08-14 22:23 Draymonder 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页