码迷,mamicode.com
首页 >  
搜索关键字:AC    ( 12438个结果
PAT:1015. Reversible Primes (20) AC
#include#include#includeusing namespace std;int D[111]; //存放拆解的数字int DI=0; //D的数组下标bool isPrime(int n){ if(n<=1) return 0; int ...
分类:其他好文   时间:2015-03-06 12:23:02    阅读次数:130
HDU 2222 Keywords Search (AC自动机入门 模板)
HDU 2222 Keywords Search (AC自动机入门 模板)...
分类:其他好文   时间:2015-03-06 11:22:27    阅读次数:138
Aizu 1311 Test Case Tweaking(spfa变形,dp)
题目链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1311 题意: 给出一张有向图,和一个权值c,问将1~n亮点之间的最短路径花费降到c,最少需要修改多少条边。 数据规模是100个点,1000条边。 思路:这道题题目的最关键点就是想到用一个二维数据去记录每个点的情况(也就是dp式子的定义) dp[x][y] 表示从顶点1...
分类:其他好文   时间:2015-03-06 01:04:55    阅读次数:140
UVALive 4670 Dominating Patterns --AC自动机第一题
题意:多个模板串,一个文本串,求出那些模板串在文本串中出现次数最多。解法:AC自动机入门模板题。代码:#include #include #include #include #include #include #include #include #include #include #define M...
分类:其他好文   时间:2015-03-05 23:41:49    阅读次数:155
hdu2457---DNA repair(AC自动机+dp)
Problem Description Biologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of simplicity, a DNA is represented as a string conta...
分类:其他好文   时间:2015-03-05 21:03:31    阅读次数:155
PAT:1069. The Black Hole of Numbers (20) AC
#include#includeusing namespace std;const int AIM=6174;int n;int arr[4];bool NonIncreasingOrder(int a,int b){ return a>b;}bool NonDecreasingOrder(int....
分类:其他好文   时间:2015-03-05 20:59:09    阅读次数:156
PAT:1019. 数字黑洞 (20) AC(同甲级1069)
#include#includeusing namespace std;const int AIM=6174;int n;int arr[4];bool NonIncreasingOrder(int a,int b){ return a>b;}bool NonDecreasingOrder(int....
分类:其他好文   时间:2015-03-05 20:52:58    阅读次数:215
HDU 2222 Keywords Search (初学AC自动机)
我是通过http://wenku.baidu.com/view/4e70ccc38bd63186bcebbcb9.html的第二篇学会的 这篇也总结的很好,附带很多经典的习题http://www.cppblog.com/menjitianya/archive/2014/07/10/207604.html 这是bin神的总结:http://www.cnblogs.com/kuangbin/p/3...
分类:其他好文   时间:2015-03-05 19:36:07    阅读次数:186
PAT:1008. Elevator (20) AC
#includeint main(){ int n,ans=0,now=0; //要停n层,ans是总时间,now代表当前层数 scanf("%d",&n); for(int i=0 ; inow) //上楼,每上一层6秒 { ans+=(tmp...
分类:其他好文   时间:2015-03-05 19:03:54    阅读次数:104
ZOJ3228---Searching the String(AC自动机)
Little jay really hates to deal with string. But moondy likes it very much, and she’s so mischievous that she often gives jay some dull problems related to string. And one day, moondy gave jay another...
分类:其他好文   时间:2015-03-05 14:48:39    阅读次数:177
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!