AC Automatic Machine

Source: Internet
Author: User

Learning Reference:

http://blog.csdn.net/niushuai666/article/details/7002823

Http://www.cnblogs.com/kuangbin/p/3164106.html

A state transition diagram can be created by means of an AC automaton, and many problems can be solved on the basis of this conversion diagram:

Because Nex[i][j] represents the next selection of J for state I. We can make this conversion into motion rules, matrix fast power, search and so on.

POJ 2778 DNA Sequence (ac automata + Matrix fast Power)

It is known that a string of length n str is made up of a,t,g,c, which gives you m substrings. How many types of str do not contain these substrings

Problem Solving Report

Spoj 1676 AC automaton + matrix fast

I'll give you a string of M, for the kind of strings that contain any number of them in length n.

Problem Solving Report

HDU 2896 virus Attack AC automaton (find out which substrings are included)

Find which substrings are included in the string

Problem Solving Report

HDU 3065 AC Automaton (number of occurrences of each sub-string)

Give you the M substring, and then look up the substrings from a string which have occurred and how many times

Problem Solving Report

HDU 2243 Entrance Examination Road boundless--word complex (AC auto + matrix)

I'll give you the M substring. The number of strings containing at least one substring of length not greater than n

Problem Solving Report

HDU 2457 AC automatic machine +DP

Give you n substrings and a main string. Modify the primary string at least how many times so that it does not contain substrings

Problem Solving Report

HDU 2825 AC automaton + pressure DP

Give you m substring, the number of scenarios where at least k substrings appear in the main string of length n

Problem Solving Report

HDU 2296 ac automaton +DP (get the most valuable string)

To you M-strings, each substring has its own value, allowing you to find the most valuable string with a length of less than or equal to N.

Problem Solving Report

HDU 3341 Lost ' s revenge ac automaton +DP

The position in the N substring and a string str,str can be arbitrarily adjusted. How many substrings may be included

Problem Solving Report

ZOJ 3228 searching the String (AC automaton)

Give you a couple of substrings, and then query the string for the number of occurrences. But 0 means you can repeat, 1 means you can't

Problem Solving Report

HDU 3247 AC automatic + pressure DP+BFS treatment

give you n normal substring, m virus substring, find the shortest string (contains all normal substrings, does not contain the virus string)

Problem Solving Report

AC Automatic Machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.