[Go] POJ string classification

Source: Internet
Author: User

POJ1002-487-3279 (Basic)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1002
Test instructions: Slightly
Solution: Two-fork lookup number, map, quick-line ...

POJ1200-crazy Search (Basic)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1200
Test instructions: Find out the number of different substrings, the size of the alphabet and the length of the substring will be given, it is recommended that the hash beginners do
Solution: Hash (recommended Karp-rabin)

POJ1204-word Puzzles (Basic)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1204
Test instructions: Basic multi-string matching
Solution: Multi-string matching automata (a single string will definitely time out)

POJ1229-wild Domains (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1229
Test instructions: Fuzzy matching
Solution: DP

POJ1625-censored! Medium
http://acm.pku.edu.cn/JudgeOnline/problem?id=1625
Test instructions: The number of strings that do not include the given pattern string for length n. (Test instructions with 2778, but can not press 2778 of the method, it is recommended to do this first, then do 2778)
Solution: Aho-corasick Automatic + DP
Related: http://hi.baidu.com/zfy0701/blog/item/c62f41afca8180ca7cd92a19.html

POJ1743-musical Theme (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1743
Test instructions: Find the longest non-overlapping substring in a string
Solution: Suffix array + binary enumeration answer, suffix array + stack scan, rk+ Two-point enumeration answer
Related: http://hi.baidu.com/zfy0701/blog/item/f2278a0928991dca3bc763a0.html
POJ1816-wild Words (Medium, absolute trie apply good questions, but also search good questions)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1816
Test instructions: Extended multi-string pattern matching (incl., *)
Solution: Trie + DFS, interested also can be used based on bit parallel automata (can refer to flexible string matching, extended matching chapters)

POJ2185-milking Grid (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=2185
Test instructions: Cover of minimum moment type
Solution: KMP (Not many KMP good questions)
Related: http://acm.pku.edu.cn/JudgeOnline/showmessage?message_id=33571

POJ2513-colored Sticks (Basic)
http://acm.pku.edu.cn/JudgeOnline/problem?id=2513
Test instructions: Transforming into a Euro-pull circuit
Solution: And check set +hash, and check set +trie

POJ2774-long Long Message (medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=2774
Test instructions: Find a two-string public eldest son string
Solution: Suffix array, Oracle factor automaton, suffix automaton
Related: http://hi.baidu.com/zfy0701/blog/item/f2278a0928991dca3bc763a0.html
Http://hi.baidu.com/zfy0701/blog/item/d9fedbd14581113d9b5027ab.html

POJ2778-dna Sequence (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=2778
Test instructions: The number of strings that do not include the given pattern string for length n.
Solution: Aho-corasick automata (prefix tree) + matrix fast Multiplication
Related: http://hi.baidu.com/zfy0701/blog/item/f2278a0928991dca3bc763a0.html
Similar to 1625, it is recommended to do 1625 first

POJ1699-best Sequence (Basic)
http://acm.pku.edu.cn/JudgeOnline/problem?id=1699
Test instructions: Convert to TSP problem (note the inclusion relationship of the substring!) )
Solution: Backtracking, State DP

POJ3376-finding palindromes (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3376
Test instructions: Retrieve string combination
Solution: Find the law, then trie + KMP Promotion form

POJ3415-common substrings (more difficult)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3415
Test instructions: Counts the number of common substrings of length >=k in two strings
Solution: Suffix array + stack scan, suffix automaton
Related: http://hi.baidu.com/zfy0701/blog/item/f2278a0928991dca3bc763a0.html

POJ3080-blue Jeans (If you use violence, it's easy)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3080
Test instructions: Find the longest common substring of n strings
Solution: Suffix array + stack scan, suffix array + binary enumeration, violence
Related: http://hi.baidu.com/zfy0701/blog/item/57ada7edf5f44ed1b31cb1cc.html

POJ3208-apocalypse someday (more difficult)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3208
Test instructions: Slightly
Solution: An interesting automaton DP

POJ3261-milk Patterns (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3261
Test instructions: To find the oldest string in a string that repeats at least k times
Solution: Suffix array + stack scan, hash + dichotomy

POJ3294-life Forms (more difficult, highly recommended)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3294
Test instructions: n strings, for all the oldest strings that are greater than the N/2 string
Solution: Suffix array + stack scan, brute force (easy to get stuck off), suffix array + line tree (?)
Related: http://hi.baidu.com/zfy0701/blog/item/57ada7edf5f44ed1b31cb1cc.html

POJ3576-language Recognition (medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3576
Test instructions: For a DFA, it satisfies two conditions, 1, can recognize all words dfa,2, requires the least number of States.
Solution: Trie + Hash
Related: http://hi.baidu.com/zfy0701/blog/item/b8332b5cd90e7b45fbf2c033.html

POJ3581-sequence (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3581
Test instructions: Divide the original string into three segments and reverse the string of the smallest dictionary order
Solution: Suffix Array
I thought it was water, but it was one of the worst failures I've done. Suffix array problem

POJ3630-phone List (Basic, strongly recommended to practice trie with this problem)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3630
Test instructions: give n a string to see if there is a string that is the prefix of another string
Solution: Quick-row, Trie

POJ3690-constellations (Basic)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3690
Test instructions: Two-dimensional string matching
Solution: Convert to one-dimensional, or multiple-string matching

POJ3691-dna Repair (Medium)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3691
Test instructions: Fixed minimum number of characters to replace illegal strings
Solution: Dynamic Programming, if the use of AC automata to do DP words is relatively simple and only need two-dimensional, with Dp[j] for the first character, the state of J (not illegal state) required minimum amount of modification

POJ3693-maximum repetition substring (difficult)
http://acm.pku.edu.cn/JudgeOnline/problem?id=3693
Test instructions: Find the most up-to-the-loop substring
Solution: The best thing I know is to do s-factorization first (that is, Lempel-ziv), then enumerate the cycles in each segment after decomposition, the period can be determined by derivation of the relationship between the legality, and then can determine the number of cycles, take the largest, The middle also uses the extension to the KMP. In particular, there are KK algorithms, and ML algorithm two, where ML can not traverse all runs.

Other OJ:

SPOJ2743-prefix Tiling
Http://www.sPOJ. pl/problems/pretile/
Find the Rules

Empty can Cans (this machine DP is still interesting)
http://cat.nknush.kh.edu.tw/ZeroJudge/ShowProblem?problemid=b179

Hdoj 2471-history of Languages (Hangzhou live race)
http://acm.hdu.edu.cn/showproblem.php?pid=2471
Equivalence of the automata, dividing the set of DP

[Go] POJ string classification

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.