Problems
Pick a problem and write your solution in the built-in editor. The judge runs it against real test cases while you watch, and the wider archive is open to read whenever you like.
Total results1,786 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Codejamon Cipher (Large)Count how many sentences built from vocabulary words, each word internally shuffled, concatenate to each given enciphered string. | Medium7 | Dynamic programmingString+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Interleaved Output: Part 1Given a string over I, O, i, o, find the maximum number of times the event IO could have been printed. | Medium7 | GreedyStack+1 | No attempts yet | 20s | 1024 MB | Judgeable |
| Interleaved Output: Part 2Given a string that four computers can interleave into, find the largest number of times the IO computer could have printed its name. | Medium7 | Dynamic programmingGreedy+1 | No attempts yet | 20s | 1024 MB | Judgeable |
| Close Match (Large)Fill question marks in two equal-length digit strings to make the scores as close as possible, breaking ties by the smallest C then smallest J. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Longest Palindromic SubstringGiven a lowercase string of up to 100,000 characters, report the length of its longest palindromic substring. | Medium7 | StringString matching+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Counting Palindromes (Small)Count how many subsequences of a string of length up to 30 are palindromes, treating subsequences that use different positions as distinct. | Medium7 | Dynamic programmingString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Unbalanced ParenthesesFlip some parentheses, each at a given cost (possibly negative), so that no sequence of at most k more flips can balance the string; minimize total cost. | Medium7 | GreedyString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Counting Palindromic Subsequences (Large)Count subsequences of a string (positions distinguish repeats) that read as palindromes, modulo 10007. | Medium7 | Dynamic programmingString | No attempts yet | 2s | 512 MB | Judgeable |
| Stack ConstructionFor each message, compute the minimum number of stack push, pop, and print operations needed to print it and leave the stack empty. | Medium7 | Dynamic programmingString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Buggy ICPCCount the strings W of the same length as T that produce T on a machine that reverses the line every time a vowel is typed. | Medium7 | CombinatoricsString+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Palindromic PartitionsSplit a string into chunks so the chunk sequence is a palindrome, and report the maximum number of chunks possible. | Medium7 | StringGreedy+2 | No attempts yet | 10s | 128 MB | Judgeable |
| InitialsEach student's directory starts as last-initial plus first-initial; append letters from the full names so names strictly increase in class order, minimizing total letters added. | Medium7 | Dynamic programmingString+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Column AdditionGiven three n-digit strings, erase the fewest digit columns so the first number plus the second equals the third. | Medium7 | Dynamic programmingString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Vera and LCSGiven string A and target K, find the smallest i where A's prefix of length i plus N-i copies of A's least frequent letter has LCS exactly K with A. | Medium7 | StringDynamic programming+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Minimum Edit 2Compute the minimum number of insertions, deletions, replacements, and adjacent swaps needed to turn string A into string B, with both strings up to length 1000. | Medium7 | Dynamic programmingString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Separate StringCount the ways to split string t into a sequence of pieces, each of which is one of N given dictionary strings, modulo 1e9+7. | Medium7 | Dynamic programmingTrie+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ParenthesesGiven A, output the shortest parentheses string whose minimum number of adjacent swaps to become balanced is exactly A, breaking ties lexicographically. | Medium7 | GreedyMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Compressed FormulaEvaluate an arithmetic formula with +, -, * over non-negative integers, given as N runs where each short string repeats r_i times, and print the result modulo 1,000,000,007. | Medium7 | MathString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Equals are EqualsParse multivariate polynomial expressions with integer coefficients and decide whether each student answer is equivalent to the reference expression. | Medium7 | StringImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Winter Olympic GamesReplace one contiguous block of a binary string (possibly empty) by a single 1, empty block inserts without deleting, to make the resulting string lexicographically largest. | Medium7 | GreedyString+2 | No attempts yet | 5s | 1024 MB | Judgeable |
| Repeated PatternAppend at most K letters to S so it becomes repetitions of one word, and output the longest possible word length (at most N), or 0. | Medium7 | String matchingString+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Jumbled StringGiven counts of subsequences 00, 01, 10, and 11, output a bit string producing exactly those counts. | Medium7 | CombinatoricsGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Future GenerationChoose a nonempty subsequence of each given name so the chosen strings are strictly increasing lexicographically and their total length is maximized. | Medium7 | Binary searchBit manipulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| KMPEach of N scientists has letters from the first characters of their name words. For each query, decide whether its letters can be matched one each to distinct scientists, with order ignored. | Medium7 | Bit manipulationDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Selling RNA StrandsGiven N RNA strings, answer M queries that count strings matching a prefix P and suffix Q. | Medium7 | String matchingHash map+2 | No attempts yet | 1.5s | 1536 MB | Judgeable |
| Comfortable StringCount how many substrings of a bracket string are both correctly balanced and symmetric under reversal with bracket swap. | Medium7 | Dynamic programmingString+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Longest Common SubstringGiven up to 10 lowercase strings, each up to 100,000 characters, find the length of the longest substring shared by all of them. | Medium7 | StringBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Contiguous Repeated StringGiven string S and k, choose k appended characters so that the resulting string has the longest substring of the form TT (a block repeated twice back to back), and report that length. | Medium7 | StringBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Subsequences in SubstringsCount how many substrings of s contain t as a subsequence at least once. | Medium7 | Two pointersDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| IspitDecide whether some block of K consecutive columns can have its letters shuffled within each row so that two rows become equal. | Medium7 | Sliding windowHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| First of Her NameGiven a family tree where each lady's name is her first letter prepended to her mother's name, count for each query string how many lady names have it as a prefix. | Medium7 | StringTrie+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Alphabet StringCount distinct strings formed by sorting the distinct characters of every substring of an uppercase string and removing duplicates. | Medium7 | StringHash map+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Choosing a BiasGiven N friends and M members, each friend lists acceptable members; decide if a distinct member can be assigned to each of the N friends. | Medium7 | GraphString+2 | No attempts yet | 2s | 256 MB | Judgeable |
| NVWLSGiven a dictionary of words and a consonant-only message, reconstruct a sentence whose words concatenate to the message after vowels and spaces are removed, maximizing total vowels. | Medium7 | Dynamic programmingString+2 | No attempts yet | 6s | 1024 MB | Judgeable |
| MathemagiciansGiven two red/blue colorings of a circle of n people, decide whether repeated moves, where one person copies a neighbor's color, can turn the first coloring into the second. | Medium7 | StringGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Eggfruit CakeCount the circular contiguous slices of a fruit border that contain at least one eggfruit ('E') and at most S fruits, where slices are distinguished by which fruits they include. | Medium7 | Two pointersSliding window+2 | No attempts yet | 0.1s | 512 MB | Judgeable |
| Parentheses EditorAfter each push of '(' or ')' or one backspace, print the number of balanced substrings in the current text. | Medium7 | StackDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Letter WheelsThree cyclic strings over {A,B,C}; rotate each independently to make every column have three distinct letters, minimizing total rotation steps. | Medium7 | StringBrute force+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Beautiful NowGiven an integer n and a swap budget k, find the smallest and largest numbers reachable by swapping digit positions, where no intermediate or final number may have a leading zero. | Medium7 | GreedyBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Equal DigitsCount the ways to delete disjoint substrings of length over 1 whose first and last digits match, so the remaining non-empty string has all distinct digits. | Medium7 | Dynamic programmingCombinatorics+2 | No attempts yet | 3s | 256 MB | Judgeable |
| Shortest Accepted WordParse a regular expression over a, b, c and $ into a tree, then compute the shortest lexicographically smallest string each node accepts. | Medium7 | Dynamic programmingString+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Geese vs. HawksMatch games of two teams so that every paired game's win/loss outcome agrees, maximizing the total points scored by both teams in the matched games. | Medium7 | Dynamic programmingString+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Error ReportGiven a sequence of function numbers from concatenated stack traces, build a call graph of minimum edge count where all traces come from errors in at most two functions. | Medium7 | GraphGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Palindrome SentencesGiven up to 13 distinct words, count ordered arrangements of a subset of them whose concatenation without spaces forms a palindrome. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Zero Run PatternGiven two binary strings repeated in a growing pattern, find the first position within the first 10^16 characters where C consecutive zeros occur. | Hard8 | StringBinary search+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Non-Repeating WordFind the lexicographically smallest length-N string over the first A letters that never contains K consecutive copies of any nonempty block. | Hard8 | BacktrackingString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Increasing ListReplace every '?' in a string with a digit or comma to form the lexicographically smallest strictly increasing list of positive integers with no leading zeros, or print -1 if impossible. | Hard8 | BacktrackingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Count Palindromic Word SequencesCount ordered sequences of given words, space-joined, whose concatenation (ignoring spaces) is a palindrome of length at most K, modulo a prime. | Hard8 | Dynamic programmingString matching+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Magic StoneGiven n, k, and i, find the i-th lexicographically smallest length-n I/X string with at most k differing adjacent pairs, treating a string and its reverse as identical. | Hard8 | CombinatoricsDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Increasing SequenceSplit a digit string into pieces forming a strictly increasing sequence of numbers, minimizing the last value with tie-breaks favoring larger earlier numbers. | Hard8 | Dynamic programmingString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Merge WordsGiven up to 12 uppercase words, find the shortest string containing all of them as substrings, breaking ties by lexicographic order. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Increasing SequenceSplit a huge digit string into pieces forming a strictly increasing sequence of numbers, breaking ties by minimizing the last piece then maximizing earlier pieces, and output the product mod 1,000,000,003. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Nested Reversal SequenceGiven two binary strings, find the minimum number of substring reversals, each interval nested inside the previous one, needed to turn the first string into the second, or report impossibility. | Hard8 | StringGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| DuelTwo players alternately mark empty cells on a strip, winning instantly by forming three consecutive marks, and the task is to decide if the first player can force a win and list all winning first moves. | Hard8 | Game theoryCombinatorics+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Palindrome EncodingGiven a binary string, repeatedly delete the second half of any even-length palindromic substring and find the minimum length achievable. | Hard8 | Dynamic programmingString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Partial DNA SubstringsGiven a DNA string, count distinct substrings occurring at least m times and find the K-th one under length-then-lex order. | Hard8 | String matchingBinary search+1 | No attempts yet | 2s | 16 MB | Judgeable |
| Number of TreesCount the number of rooted ordered trees whose DFS-with-repeated-parent-writes traversal string equals a given string, modulo 1e9. | Hard8 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Compressing a StringFind the minimum length of a string obtained by optimally applying nested k(S) run-length style compression to a given lowercase string of length up to 200. | Hard8 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Tennis MatchSimulate a multi-player variant of tennis with custom scoring, serving rotation, and set/match rules to determine the overall winner from a sequence of game winners. | Hard8 | SimulationImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Number of Expression ValuesCount the distinct values an unspaced digit/operator string can yield when each subexpression is parsed as prefix, infix, or postfix. | Hard8 | Dynamic programmingString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Binary Sequence RotationGiven the last column of a sorted matrix of all circular rotations of an unknown binary string, reconstruct the lexicographically smallest rotation (first row) or report impossibility. | Hard8 | String matchingSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Finding a Momentum SequenceGiven a digit string, decide if it can be split into an arithmetic progression followed by a term equal to the last progression term times some integer f, and output the minimal possible f. | Hard8 | StringMath+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Message ConverterParse a MULTI markup string with tags for newline, justification, and spacing, then render it into a fixed-size character grid while detecting conflict, size, and syntax errors. | Hard8 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Beautiful WordSimulate a turn-based letter-picking game where one player greedily takes the rightmost slip while the other picks optimally to form the lexicographically smallest possible word, then compare outcomes. | Hard8 | GreedyGame theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Roman Numeral WalkFind the longest path from the grid center through empty-separated cells that spells consecutive Roman numerals starting at 1, and print the last number reached. | Hard8 | DFSBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Martian DNA FormulaCompress a DNA string into the shortest possible run-length style notation using nested parentheses with repeat counts. | Hard8 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| RLE CompressionDecode a custom run-length encoding scheme and compute the minimum possible length of any code that decodes to the same character sequence. | Hard8 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Vigenère Cipher AnalysisDetermine, for each candidate Vigenère key length up to K, whether the unique decrypted plaintext contains two given cribs at non-overlapping positions, and report the plaintext, ambiguous, or impossible. | Hard8 | String matchingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| InsultsParse a string against a context-free grammar defining insults, then find the lexicographically next same-length valid insult or report invalid/ultimate. | Hard8 | StringDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Repetition-Free FormulaParse a Boolean formula that may repeat variables, determine if the underlying function is read-once, and if so print its canonical repetition-free formula. | Hard8 | RecursionString+2 | No attempts yet | 2s | 64 MB | Judgeable |
| Secret Code: Largest NumberGiven a noisy string, find the largest decimal number it could decode to, either fixing one language for all digits or allowing a different language per digit, using digit-word subsequence matching. | Hard8 | Dynamic programmingString matching+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Software Industry RevolutionGiven a wildcard pattern (with ? and *) and a text, find the minimum-complexity substring of the text that matches the whole pattern, or report impossible. | Hard8 | String matchingDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ACGUGiven an RLE-encoded RNA-like string, find the maximum number of non-crossing A-U and C-G pairs with at most K C-G pairs, exploiting the special RLE size constraints. | Hard8 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| GeneticsSimulate a topological genus-computing reduction system on circular DNA strings of paired letters to determine the resulting count of arms or legs. | Hard8 | SimulationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Stammering AliensGiven a string and a minimum repeat count m, find the longest substring occurring at least m times (overlaps allowed), breaking ties by rightmost starting position, using suffix array or suffix automaton techniques. | Hard8 | String matchingBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Matrix CalculatorParse and evaluate a matrix expression language with block matrices, transpose, indexing, and modular arithmetic, printing each assignment's resulting matrix. | Hard8 | RecursionMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Organize Your TrainGiven a small rail-yard graph with parking lines and exchange links, compute the minimum number of sub-train moves to transform an initial arrangement of typed cars into a target arrangement. | Hard8 | BFSSimulation+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Magical CraftingGiven binary crafting recipes with diamond costs, decide for each target string of glow stones whether it can be produced from 'A' and find the minimum diamond cost. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Disjoint Regular ExpressionsGiven two regular expressions, decide whether any non-empty string matches both, and if so print the shortest lexicographically smallest such string. | Hard8 | Dynamic programmingBFS+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Fibonacci WordGiven a bit pattern p and an index n up to 100, count the possibly overlapping occurrences of p inside the Fibonacci word F(n), whose length grows exponentially. | Hard8 | String matchingDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Intellectual PropertyGiven two code bases as raw strings, find the k longest maximal substrings of the JCN base that also occur in the TDP base, with exact positions and lengths. | Hard8 | String matchingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Language CardinalityCount the distinct strings a string-rewriting grammar generates from a start string, printing Too many. if the count exceeds 1000. | Hard8 | StringBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tail PalindromeGiven two lowercase strings a and b, find the shortest string x such that exactly one of ax, bx is a palindrome, and among ties the lexicographically smallest x. | Hard8 | StringString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Crypt KickerDecrypt each line of a substitution cipher so every word appears in a given dictionary, choosing the lexicographically smallest result, or mask the line if none exists. | Hard8 | BacktrackingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Barcode of JudgmentA barcode is a fixed 7x9 grid pattern placed somewhere in a binary image, possibly rotated; find all valid placements and decode the data bits, or report none or ambiguity. | Hard8 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word LadderGiven a vocabulary, find the longest shortest path (number of words) between any two words where a move changes, adds, or removes one letter. | Hard8 | GraphBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| WhenExecute a complete When program, an event-driven language with simultaneous Set assignments and a rotating active-clause scheduler, and print its output. | Hard8 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A-to-ZGiven a word dictionary, for each pair of letters find the minimum total width of a word chain where consecutive words overlap by at least two letters, and the first starts with C1, the last ends with C2. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Alpha of Degree kGiven a dictionary, answer queries asking for the shortest chain from word s to word t where each step shares a suffix-prefix overlap of length at least k, with a cap on chain length. | Hard8 | GraphBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Weaker than PlannedGiven candidate plaintext words and a ciphertext message, recover the plaintext under one unknown letter-pair substitution, or report that it is not unique. | Hard8 | BacktrackingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| City MergerGiven up to 14 uppercase city names, find the length of the shortest string that contains every name as a consecutive substring, allowing overlaps. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| InfiltrationGiven an encrypted line using a one-to-one letter substitution, recover the plaintext if exactly one consistent mapping exists using a subset of twelve known words that covers all distinct cipher letters. | Hard8 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DNA CopyGiven a source string S of length at most 18, find the minimum number of copy operations (each taking a contiguous substring of S or of the already-built target, optionally reversed) needed to assemble T. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CipherFind the a x b subarray that occurs exactly k times (k >= 3) in an n x m character grid and list all its top-left positions in row-major order. | Hard8 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Spelling SuggestionGiven weighted edit costs including keyboard-aware substitution and transposition, find the dictionary words closest to each query word. | Hard8 | Dynamic programmingString+2 | No attempts yet | 12s | 128 MB | Judgeable |
| Sanghak LanguageCount the distinct strings formed by concatenating any nonempty prefix of a Namgyu word with any nonempty suffix of a Jaehyeok word, summing over several test cases. | Hard8 | TrieString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| File SearchCount how many non-empty subsets of the files can be exactly the result set of some substring query. | Hard8 | StringTrie+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Code LockGiven a target lowercase string starting from all 'a', find the minimum number of moves where each move shifts a contiguous block of wheels up or down by one. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| File RecoverCount the distinct contiguous substrings that occur at least twice in a given string, for several test cases up to 100000 characters each. | Hard8 | StringString matching+1 | No attempts yet | 5s | 128 MB | Judgeable |
| DNA SubsequenceFind the longest common subsequence of two words where every maximal matched run must be a contiguous block of at least K characters in both words. | Hard8 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |