码迷,mamicode.com
首页 >  
搜索关键字:AC    ( 12438个结果
POJ刷题
这篇文章会持续更新, 记录我所有AC的POJ题目。PS:我所有的POJ代码都存在我的github上。1000 A+B水题不说。1001 Exponentiation求一个数的n次方,用高精度,注意细节。1002 487-3279题目描述:设计程序,按照功能机上的9键键位把字母电话号码转化成数字电话号...
分类:其他好文   时间:2015-05-28 15:49:27    阅读次数:173
如何在Struts2的拦截器中调用Spring容器
第一种: 通常用ApplicationContext来调用Spring配置文件中的一些Bean,所以首先创建Spring上下文容器。 ApplicationContext ac = (ApplicationContext) invocation.getInvocationContext().getA...
分类:编程语言   时间:2015-05-27 22:47:07    阅读次数:233
九度oj 1521 二叉树的镜像
原题链接:http://ac.jobdu.com/problem.php?pid=1521水题,如下。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std::cin; 8 usi...
分类:其他好文   时间:2015-05-27 22:46:14    阅读次数:261
九度oj 1348 数组中的逆序对
原题链接:http://ac.jobdu.com/problem.php?pid=1348归并排序求逆序对。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 typedef unsigned long long ull; 7 co...
分类:编程语言   时间:2015-05-27 22:29:53    阅读次数:233
北大ACM1328——Radar Installation~~贪心
题目的大概意思是:给你N个坐标,雷达的半径为d,求至少安装多少个雷达才能将所有点覆盖。雷达都在 x 轴上,不能全部覆盖的就输出 -1. 思路大概是,先算出雷达覆盖每一个点的横坐标的范围。然后再来贪心求解有几个。 下面的是AC的代码: #include #include #include using namespace std; class data { public: double...
分类:其他好文   时间:2015-05-27 15:48:26    阅读次数:127
九度oj 1407 快速找出最小数
原题链接:http://ac.jobdu.com/problem.php?pid=1407线段树,区间更新,查询区间最小值。注意区间更新,查询的时候,区间$\begin{align*}[L,R] \end{align*}$$\begin{align*}L \end{align*}$都可能大于$\be...
分类:其他好文   时间:2015-05-27 15:29:16    阅读次数:116
HDU 2846 (AC自动机+多文本匹配)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2846题目大意:有多个文本,多个模式串。问每个模式串中,有多少个文本?(匹配可重复)解题思路:传统AC自动机是计算单个文本中,模式串出现次数。这里比较特殊,每个文本需要单独计算,而且每个匹配在每个文本中只...
分类:其他好文   时间:2015-05-27 15:27:55    阅读次数:113
bzoj2085
首先看到k的范围就该知道这题不是倍增就是矩乘首先肯定要求出任意一对串(a,b) a的后缀与b的前缀相同的最长长度是多少考虑到kmp求出的失配指针是一个串最长后缀和前缀相等的长度这里多个串我们只要用ac自动机即可具体的,我们只要建立自动机,然后记录每个状态点是哪些串的子串然后我们只要从每个串的结尾节点...
分类:其他好文   时间:2015-05-27 15:24:18    阅读次数:139
九度oj 1349 数字在排序数组中出现的次数
原题链接:http://ac.jobdu.com/problem.php?pid=1349二分。。 1 #include 2 #include 3 #include 4 #include 5 using std::lower_bound; 6 using std::upper_bound; 7 co...
分类:编程语言   时间:2015-05-27 13:44:30    阅读次数:208
九度oj 1554 区间问题
原题链接:http://ac.jobdu.com/problem.php?pid=1554由数列的前缀和:$\begin{align*}\Large{} S_n &=\Large{}\sum_{i=1}^{n}{{a_i}} \ \ \ \ i=1,2,3...n\end{align*}$由于:$\...
分类:其他好文   时间:2015-05-27 11:47:54    阅读次数:172
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!