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,787 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
PeriodFor every prefix of a string, find the largest exponent K such that the prefix equals some string A repeated K times, using KMP failure function.Medium4String matchingString+1No attempts yet1s128 MBJudgeable
Common SubsequenceCompute the length of the longest common subsequence of two given strings for multiple test cases.Medium4Dynamic programmingStringNo attempts yet1s128 MBJudgeable
Guess the NumbersDetermine whether some permutation of up to 5 given values assigned to the unknowns in a fully parenthesized arithmetic expression makes it evaluate to a target result.Medium4Brute forceRecursion+1No attempts yet1s128 MBJudgeable
Molecular FormulaParse a nested molecular formula with repetition counts and atomic weight lookups to compute total molecular weight, or report UNKNOWN.Medium4RecursionString+1No attempts yet3s128 MBJudgeable
Pizza HawaiiFor each local ingredient and native ingredient, output the pair when the two words appear on exactly the same set of pizza names.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
Touchscreen KeyboardGiven a typed word and a list of same-length dictionary words, print each with its keyboard Manhattan distance, sorted by distance then lexicographically.Medium4StringSorting+2No attempts yet1s128 MBJudgeable
DigitsGiven a huge decimal number, repeatedly replace it with its digit count and report the first step where the value stops changing.Medium4MathImplementation+2No attempts yet1s128 MBJudgeable
TautologyGiven propositional formulas in Polish notation, decide for each whether it is a tautology by parsing and evaluating it over every truth assignment.Medium4StringRecursion+2No attempts yet1s128 MBJudgeable
Basic ModuloRead base-b numbers p and m, with p up to 1000 digits, and print the remainder of p divided by m in base b.Medium4MathNumber theory+2No attempts yet1s128 MBJudgeable
System of Linear EquationsParse two linear equations and report each unknown as a reduced fraction, or as don't know when it is not uniquely determined.Medium4MathImplementation+1No attempts yet1s128 MBJudgeable
Crypt Kicker IIOne input line is the pangram 'the quick brown fox jumps over the lazy dog' encrypted by a letter substitution; find it, build the table, and decrypt every line.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
A Smart Brain is a Tasty BrainParse each of up to 10000 Boolean expressions, evaluate it, and report whether the brain's given answer matches.Medium4StringStack+2No attempts yet1s128 MBJudgeable
Symbolic Logic MechanizationParse a prefix logic formula, report the first syntax error left to right, then classify it as a tautology, contradiction, or contingent.Medium4StringRecursion+2No attempts yet1s128 MBJudgeable
Tribute (Editor)Simulate a buggy modal editor: given keystrokes, apply insert, delete, duplicate, reverse, and cursor commands, then print the buffer with a caret marking the cursor position.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
Grade School MultiplicationFormat a grade-school multiplication display column by column, handling zero digits in the second operand and single-line answers.Medium4StringSimulation+2No attempts yet1s128 MBJudgeable
Linear PachinkoFor each linear Pachinko string, compute the percentage chance that a ball dropped on a uniformly random character exits through a hole or off an end, truncated to an integer.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
Frugal SearchGiven a word list and queries of bar-separated terms with unsigned, plus, and minus letters, output the lexicographically smallest matching word or NONE for each query.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Instruens FabulamRead a header specifying each column's alignment, then print each table with borders, sized columns, and aligned cells.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Automatic EditingApply a fixed list of find-and-replace rules in order, repeatedly replacing the first occurrence of each find string until it no longer appears, and print the final text.Medium4StringSimulation+2No attempts yet1s128 MBJudgeable
Equation ElationRepeatedly reduce an arithmetic expression on the left of an equals sign by performing one operation at a time in precedence order, printing each intermediate line.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
DNA TranslationFor each DNA strand, try all four readings (forward, reverse, complement, reverse complement), translate the first AUG to the first stop codon, and print the lexicographically greatest valid protein or a failure message.Medium4StringSimulation+2No attempts yet1s128 MBJudgeable
Letter Sequence AnalysisRead a text block to EOF and, for each sequence length 1 to 5, list the five most frequent letter sequences with alphabetized ties.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Witness Redaction PlanReplace every character of each sentence that contains a sensitive word (case-insensitive) with @, keeping the rest of the message unchanged.Medium4StringImplementation+1No attempts yet1s128 MBJudgeable
Shrew-ologyGiven per-trait dominance rules and adult shrews with sex and trait bits, list every mother-father pair that could produce each juvenile.Medium4Brute forceImplementation+2No attempts yet1s128 MBJudgeable
User NamesGenerate unique lowercase user names from full names using fixed truncation and numeric suffix collision rules, printing each result.Medium4StringHash map+2No attempts yet3s256 MBJudgeable
Set-Theoretic Number NotationParse two numbers given as von Neumann ordinal sets, add their values, and print the sum in the same nested-brace notation.Medium4StringRecursion+1No attempts yet1s128 MBJudgeable
Shortest PrefixesFor each word in a list, find the shortest prefix that matches only that word, counting an exact match as unique even if longer words share it.Medium4TrieString+2No attempts yet1s128 MBJudgeable
Shake, Rattle and RollFill a square grid with an uppercase message plus padding letters, then apply the key's sequence of shake, rattle, and roll operations and print the final flat string.Medium4SimulationMatrix+2No attempts yet1s128 MBJudgeable
CompressGiven pairs F and R with F < R, print F and the shortest compressed form C that decodes back to R.Medium4StringImplementation+1No attempts yet1s128 MBJudgeable
Spreadsheet Circular ReferenceGiven spreadsheet cell formulas as lines, decide for each defined cell whether evaluating it leads to a circular reference, printing the cell name and circular or ok.Medium4GraphDFS+1No attempts yet1s128 MBJudgeable
Stable StringGiven a string of braces, find the minimum number of single-character flips that make all brackets correctly balanced.Medium4StackGreedy+2No attempts yet1s128 MBJudgeable
A Tale from the Dark Side of the MoonReimplement a lost text filter that applies four ordered string rules per line, including conditional ei to ie and dd to p replacements, stopping at a line reading EOF.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Wooden BlocksGiven a string of digit pieces, check whether it forms a valid interlocking arrangement starting with piece 1, ending with piece 2, and matching every adjacent edge pair.Medium4ImplementationString+2No attempts yet1s128 MBJudgeable
Flatten the ExpressionParse a recursively repeated bracketed expression and print its flattened string without spaces.Medium4StringRecursion+1No attempts yet1s128 MBJudgeable
Phone ListGiven a list of distinct phone numbers, decide whether any number is a prefix of another.Medium4TrieString+1No attempts yet1s256 MBJudgeable
Web PagesFor each line of HTML-looking text, decide whether every opening tag has a matching closing tag and all tags nest properly.Medium4StackString+2No attempts yet1s128 MBJudgeable
Risk AssessmentScore each company from text by applying sentence modifiers to quality words and attributing words to the most recent company name.Medium4StringSimulation+1No attempts yet1s128 MBJudgeable
Presentation ErrorNormalize two strings by case, spacing around special symbols, bracket and comma/semicolon equivalence, then decide if they match.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Stump SpeechGiven scored key phrases and a speech, sum each phrase's score times its number of occurrences in the speech.Medium4StringString matching+1No attempts yet1s128 MBJudgeable
Breaking the Vigenère CipherFrom a ciphertext, collect all repeated 3-letter groups and their occurrence distances, then report every key length from 4 to 20 dividing at least 90% of those distances.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Next PermutationGiven an integer A, find the smallest permutation of its digits that is strictly greater than A, or print USELESS if none exists.Medium4ArrayString+2No attempts yet1s128 MBJudgeable
SignboardCount how many of the given strings contain the store name as an equally spaced subsequence, where each string counts at most once.Medium4StringBrute force+1No attempts yet1s256 MBJudgeable
Product Order TotalsSum the order quantities for each distinct product name, then print each product with its total sorted by name length, then alphabetically.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
Car Plates CompetitionDecide whether Isa's 7-character plate is a legal plate newer than Martin's by at most C positions ahead in the ACM sequence.Medium4ImplementationMath+2No attempts yet1s128 MBJudgeable
ScrabbleGiven a tray of T letters (some blanks that score 0) and an alphabetized dictionary, pick the highest-scoring dictionary word formable from the tray, breaking ties alphabetically.Medium4StringGreedy+2No attempts yet1s128 MBJudgeable
Word PowerFor each of N cow names, count how many of M good strings appear as a case-insensitive subsequence of the name.Medium4StringTwo pointers+2No attempts yet1s128 MBJudgeable
Word GamesGiven a rack of up to 10 letters with wildcards and a dictionary of up to 50000 words, print every dictionary word whose letters can be covered by the rack, in input order.Medium4ImplementationBrute force+2No attempts yet1s128 MBJudgeable
L-I-N-G-OGiven a secret five-letter word and guesses, print one feedback line per guess using upper-case for exact matches, lower-case for misplaced letters, and periods otherwise.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Number Base ConversionConvert a number given in one base to another base, where digits run 0-9, A-Z, a-z, and print a blank line after each conversion.Medium4MathString+2No attempts yet1s128 MBJudgeable
Mutilated Morse Code CipherApply Ohaver's symmetric Morse cipher: encode each message to dot-dash with a length string, reverse the lengths, and decode back to text.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Microprocessor SimulationSimulate a 4-bit microprocessor from a 256-word hex memory dump and print the final memory state when the stop instruction runs.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
Scramble SortSort words case-insensitively and integers numerically within each comma-separated list while keeping each element's original type position.Medium4SortingString+2No attempts yet1s128 MBJudgeable
KeywordsGiven keyword profiles with a gap threshold and a list of titles, report for each profile the numbers of titles where some pair of its distinct keywords appears within the threshold.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Numerically SpeakingTranslate between lowercase words of length 1 to 20 and their bijective base-26 numbers, printing output in a padded two-column format.Medium4MathString+2No attempts yet1s128 MBJudgeable
Octal FractionsRead octal fractions from 0 to 1 and print each one's exact decimal value, with trailing zeros stripped.Medium4MathString+2No attempts yet1s128 MBJudgeable
Volleyball StatsParse volleyball play-by-play lines, track kills, errors, hits, blocks, and digs per player and team, and print formatted reports on demand.Medium4ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Excuses, Excuses!Find the excuses containing the most keyword occurrences, where keywords match case-insensitively and only as whole words.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Identifying Legal Pascal Real ConstantsClassify each candidate line as a legal Pascal real constant or not, following the syntax rules for digits, decimal points, scale factors, and signs.Medium4StringImplementation+1No attempts yet1s128 MBJudgeable
CowculationsFor each tablet, simulate three operations (add, shift right, shift left, or null) on a five-symbol cow number and check the padded result equals the eight-symbol line.Medium4ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Bingo, Really?!Split the input into letter-only words, count distinct words per game ending at BULLSHIT, and print the running average as an irreducible fraction.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
Etaoin ShrdluConcatenate each sample's lines, count overlapping adjacent character pairs, then print the five most frequent digrams with their counts and rounded relative frequencies.Medium4StringHash map+2No attempts yet1s128 MBJudgeable
CompromiseFor each pair of word lists terminated by #, print the lexicographically smallest longest common subsequence of words.Medium4Dynamic programmingStringNo attempts yet1s128 MBJudgeable
Digital DisplayRender each input time as a seven-segment digital clock face 29 characters wide and 7 rows tall, then print end after all times.Medium4ImplementationSimulation+2No attempts yet1s128 MBJudgeable
Intriguing IdentifiersValidate each given identifier as a Czech Personal ID for a birth between 1920 and 2009, and report the gender or mark it invalid.Medium4ImplementationString+2No attempts yet1s256 MBJudgeable
Emag eht htiw Em PlehGiven White and Black piece lists, print the 8x8 chess board as ASCII art with alternating light and dark square fills.Medium4ImplementationSimulation+2No attempts yet1s128 MBJudgeable
English Number TranslatorParse English number words such as 'one thousand five hundred' into their integer value, handling negatives and an empty-line terminator.Medium4StringImplementation+1No attempts yet1s128 MBJudgeable
R.Ø.L.P. Code WheelFor each encoded message, try all 42 wheel shifts and print every decoding that contains the substring RØLP.Medium4StringBrute force+2No attempts yet1s128 MBJudgeable
Parsing Real NumbersGiven T lines, decide whether each line is a valid real number with optional sign, decimal point, and exponent, allowing surrounding blanks.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Expression EvaluatorEvaluate a C-style expression of letter variables with binary + and -, plus pre and post ++ and --, then report the result and each used variable's final value.Medium4StringSimulation+2No attempts yet1s128 MBJudgeable
From Prefix to PostfixTranslate each prefix arithmetic expression over + and - into its equivalent postfix form, stopping at the terminating 0.Medium4StackTree+2No attempts yet1s128 MBJudgeable
Attack of the CipherTextsGiven one plaintext/ciphertext pair, invert the letter substitution to decrypt a second ciphertext, printing a period for undetermined characters.Medium4Hash mapString+1No attempts yet1s128 MBJudgeable
Year 2000Read n lines of text and expand the two-digit year in every date that matches one of three fixed formats, leaving all other characters unchanged.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Common WordsFor each data set, count word frequencies, find the k-th most common words, and print them alphabetically after a title line.Medium4Hash mapSorting+2No attempts yet1s128 MBJudgeable
LotteryInsert parentheses into arithmetic expressions so that multiplication is grouped before addition and subtraction, keeping the original spaces.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Divisibility by 11Apply Dodgson's divisibility-by-11 test to numbers up to 50 digits, printing each intermediate value and the final verdict.Medium4MathImplementation+2No attempts yet1s128 MBJudgeable
When in Rome...Parse two Roman numerals, add them, and print the sum as a Roman numeral, or CONCORDIA CUM VERITATE when the sum exceeds 1000.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
Where's Waldorf?Given a grid of letters and a list of words, find the first-letter position of each word along any of eight straight directions, or the bottom-right cell if absent.Medium4ArrayString+2No attempts yet1s128 MBJudgeable
Double TroubleGiven an encrypted ciphertext formed by shifting letters and reversing blocks of size m, find the shift s and block size m that make a given crib appear.Medium4StringBrute force+2No attempts yet1s128 MBJudgeable
Weather ForecastingParse four weather forecast lines, score each sentence by phenomenon and qualifier, weight forecasts by day, and test whether the total is under 0.25.Medium4StringImplementation+2No attempts yet1s128 MBJudgeable
GeopeitusExpand each variable's value list, substitute every combination into the coordinate formula, and print each resulting coordinate in the specified digit order.Medium4ImplementationBrute force+2No attempts yet1s1024 MBJudgeable
Meli kalikamakaApply syllable and letter substitution rules to convert a lowercase text into a Polynesian-style pronunciation.Medium4StringSimulation+2No attempts yet1s1024 MBJudgeable
Substring ReversalGiven an original string and the result of reversing one substring of length at least two, find the reversed segment, preferring the smallest start then end.Medium4StringTwo pointersNo attempts yet1s1024 MBJudgeable
Ancient CipherGiven two equal-length strings of capital letters, decide whether the first can be obtained from the second by a substitution cipher followed by a permutation.Medium4StringSorting+2No attempts yet2s128 MBJudgeable
Chemical ReactionsParse chemical formulas with nested parentheses and multipliers, then compare element counts between the left side and each candidate right side.Medium4StringStack+1No attempts yet1s128 MBJudgeable
Buffer ManagerGiven buffer states (free, digit worthiness, or locked) in a string, find the starting position of the K-length window without locked buffers whose digit sum is smallest.Medium4Sliding windowPrefix sum+2No attempts yet1s128 MBJudgeable
ImprovisationGiven a chord progression and a melody with pauses, remap each played note to the nearest note in the current chord's scale, advancing the chord every fourth position.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
ROT13Given a list of lowercase words, count ordered pairs (w1, w2) from the list where w2 equals the ROT13 encoding of w1.Medium4Hash mapString+2No attempts yet1s128 MBJudgeable
Summing JaśAdd up to 100 signed decimal numbers with up to 100 digits on each side of the comma and print the shortest form of the sum.Medium4StringMath+1No attempts yet1s512 MBJudgeable
Guess the WordGiven each uppercase word, output the next distinct arrangement of its letters in dictionary order, or the word itself when it is already last.Medium4StringSortingNo attempts yet1s128 MBJudgeable
OulipoCount overlapping occurrences of a pattern W in a text T over uppercase letters for each test case.Medium4String matchingStringNo attempts yet1s128 MBJudgeable
Mixing WordsDecide whether the third word interleaves the first two words while keeping each word's letter order.Medium4Dynamic programmingStringNo attempts yet1s256 MBJudgeable
Special JudgeDecide whether the given string appears as a contiguous block in both A and B.Medium4String matchingStringNo attempts yet1s128 MBJudgeable
Password ValidationDecide whether each password meets length, character mix, repeat, palindrome, and forbidden subsequence rules.Medium4ImplementationString+1No attempts yet1s128 MBJudgeable
CasinoFind every longest palindromic substring of length at least 2 in each string and print them rightmost first.Medium4StringString matchingNo attempts yet1s128 MBJudgeable
CalculatorEvaluate up to 100 polynomials given as compact strings with omitted coefficients at integer X and print each result.Medium4StringMath+1No attempts yet1s128 MBJudgeable
Exact Sum of Real NumbersAdd each group of decimal numbers with up to 30 digits exactly and print the unrounded sum with trailing zeros removed.Medium4ImplementationString+1No attempts yet1s128 MBJudgeable
Word ExtractionClean each input line by lowercasing it, joining or splitting words at punctuation by neighbor rules, then print the sorted unique words per line.Medium4StringSorting+1No attempts yet1s128 MBJudgeable
Fib InverseGiven Fibonacci numbers, find each one's index, taking the larger index when two match.Medium4MathHash map+1No attempts yet1s512 MBJudgeable
Uncompressing Compressed WordsExpand each nested compressed word by concatenating its parts and repeating the group n times.Medium4RecursionStack+1No attempts yet1s256 MBJudgeable
RunesFind the smallest digit that replaces every question mark so the addition, subtraction, or multiplication equation holds.Medium4Brute forceString+1No attempts yet5s256 MBJudgeable