码迷,mamicode.com
首页 >  
搜索关键字:AC    ( 12438个结果
nyoj 1129
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=1129题目分析:感觉题目说的不是多么的清晰,看了别人的分析觉得,也就是说在一个方向不能拐四次弯;大于四次就要return了;方向可以自己定义,方便使用就好AC代码: 1 #include 2...
分类:其他好文   时间:2015-04-14 14:23:22    阅读次数:157
HDU 2222 Keywords Search
ac自动机第一题 代码参考kuangbin,用数组实现 思想参考的这个,写得很详细:http://www.cppblog.com/mythit/archive/2009/04/21/80633.html #include #include #include #include #include using namespace std; #define N 500010 struct trie...
分类:其他好文   时间:2015-04-14 11:20:25    阅读次数:103
[AC自动机+dp+高精度] poj 1625 Censored!
题意: 给一个长度为N的字符串,表示有N个字符可用。 再给p个不能含有的病毒串。 为你长度为M的串不含有任意一个病毒串的方案数。 思路: 由于不需要取模,50^50需要用到高精度。 因为题目的字符串大于32所以可以直接scanf输入。 输入完map一下就好了。 就是裸的自动机dp了。 代码: #include"stdio.h" #include"algorithm" #incl...
分类:其他好文   时间:2015-04-14 11:17:20    阅读次数:113
自己实现more命令
1 #include 2 #include 3 4 #define PAGELEN 24 5 #define LINELEN 512 6 7 int see_more(FILE*); 8 void do_more(FILE*); 9 10 int main(int ac, ch...
分类:其他好文   时间:2015-04-14 09:46:42    阅读次数:145
数学 ACdream 1196 KIDx's Triangle
题目传送门 1 /* 2 这道题花了好长时间AC,思路有,但是表达式少写了括号一直乱码,囧! 3 注意:a==0时要特判:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 ...
分类:其他好文   时间:2015-04-13 22:48:12    阅读次数:135
数位DP
数位DP的题曾经写过,但是就是各种混乱不堪=w=这次写的记忆化搜索....AC BZOJ 1833 1 #include 2 #include 3 #include 4 5 #include 6 #include 7 #include 8 #include 9 ...
分类:其他好文   时间:2015-04-13 22:46:08    阅读次数:214
网络流最经典的入门题 各种网络算法都能AC。
Drainage Ditches题目抽象:给你m条边u,v,c。 n个定点,源点1,汇点n.求最大流。 最好的入门题,各种算法都可以拿来练习(1): 一般增广路算法 ford() 1 #include 2 #include 3 #...
分类:编程语言   时间:2015-04-13 22:42:50    阅读次数:226
[LeetCode]Employees Earning More Than Their Managers,解题报告
目录目录 题目 思路 AC SQL题目The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. Id Name Salary ManagerId 1 Joe...
分类:其他好文   时间:2015-04-13 20:58:33    阅读次数:130
[LeetCode]Rising Temperature,解题报告
目录目录 题目 思路 AC SQL题目Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates. Id(INT) Date(DATE) Temperature(INT) 1 2...
分类:其他好文   时间:2015-04-13 18:54:23    阅读次数:150
bzoj 2553: [BeiJing2011]禁忌
求所有长度为 len 的串s中,最多包含多少个不重叠的子串, 的期望。开始觉得把s分成若干段这个操作让人无法下手, 但是其实一个简单的贪心就可以了, 因为如果所有子串不互相包涵的话, 一定是能取就取, 如果没有特殊限制的话, 可以把所有包含另一个子串的子串直接删掉或者是在建ac自动机的时候把end传...
分类:其他好文   时间:2015-04-13 16:10:25    阅读次数:190
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!