Curated sets

Strings and text

Parsing, matching, and tries.

All problems
Total results1,816 problems
TopicsJudge
Counting StringsCount strings over the lowercase alphabet whose length lies between L*K and L*K+N and in which at most K non-overlapping copies of a given pattern S can be found.Hard9Dynamic programmingString matching+2No attempts yet2s512 MBJudgeable
Binary cryptarithm decryptionGiven a short cipher string where letters replace some characters of an unknown binary equation, count how many valid equations from the given grammar match it.Hard9BacktrackingDynamic programming+2No attempts yet2s512 MBJudgeable
Bracket SubstringsCount how many distinct balanced bracket sequences appear as non-empty substrings of a given bracket string of length up to 500,000.Hard9StringHash map+2No attempts yet2s512 MBJudgeable
XOR QueriesMaintain an array under appends, rollbacks of the last k elements, and range queries for max XOR, count <= x, and k-th smallest.Hard9TrieSegment tree+2No attempts yet2s512 MBJudgeable
HackerSimulate substring comparisons, substring copy from a fixed string, and range letter-increment operations on a mutable string of length N.Hard9Segment treeHash map+2No attempts yet4s512 MBJudgeable
Distinct Substring QueriesMaintain a string under push-back and pop-front operations, reporting the number of distinct substrings after each of up to a million queries.Hard9StringString matching+2No attempts yet2s512 MBJudgeable
Incremental Double Free StringsFind the nth string of length k(k+1)/2 that uses one letter j times for each j up to k and has no two equal adjacent letters, in alphabetical order.Hard9CombinatoricsDynamic programming+2No attempts yet2s512 MBJudgeable
Tarot Sham BoastGiven up to 10 equal-length strings over {R,P,S} and a length n random string, sort the strings by the probability each occurs as a contiguous block.Hard9String matchingProbability+2No attempts yet2s512 MBJudgeable
PseudoknotFind the largest t such that the string splits into u v z^R u^R y z with |u|>=t and |z|>=t, or report -1 if no such split exists.Hard9StringString matching+2No attempts yet2s512 MBJudgeable
IntuidiffFind the minimum number of blocks, each a substring of the first string or a single new character, whose concatenation equals the second string.Hard9String matchingGreedy+2No attempts yet7s512 MBJudgeable
Crazy RotationsGiven a row of coloured lights, find the smallest rotation amount that can appear at position p in a non-decreasing sequence of rotation craziness values.Hard9String matchingCombinatorics+2No attempts yet15s512 MBJudgeable
KabobsCount length-K strings over the given alphabet that satisfy all substring-implication rules of the form b>e, modulo 10^7.Hard9Dynamic programmingString+2No attempts yet5s512 MBJudgeable
Want to solve a problem?For given K and C, choose A > 0 to maximize the characters saved by writing K+A repeated K+A times instead of K repeated K times, minus C times A.Hard9String matchingMath+2No attempts yet1s128 MBJudgeable
Fibonacci Digit CountCount occurrences of the substring "11" within the first N characters of the infinite string formed by writing 1, 2, 3, ... in Fibonacci (Zeckendorf) representation.Hard9MathDynamic programming+2No attempts yet2s1024 MBJudgeable
GeneratorRead an index 0 to 10 and output the exact contents of the matching recovered file gen_i.out from the archive.Hard10ImplementationString+2No attempts yet2s256 MBJudgeable
String Palindrome QueriesMaintain a lowercase string under block moves, reversals, and single-character insertions, answering after each change whether a given substring reads the same forwards and backwards.Hard10StringString matching+1No attempts yet2s256 MBJudgeable