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
TitleLevelTopicsSolvedTime limitMemory limitJudge
Progressive ScrambleEncrypt a message by cumulative sums of symbol values mod 27, and decrypt by inverting the same recurrence.Easy3ImplementationMath+2No attempts yet2s512 MBJudgeable
Vera and ABCDEGiven a string of N letters from A to E, render the 5x3 pattern for each letter side by side and print the resulting 5 rows of 3N characters.Easy3ImplementationString+2No attempts yet2s512 MBJudgeable
IDN Homograph AttackGiven a string, decide whether some character can be swapped for a different character that normalizes to the same form.Easy3StringHash map+2No attempts yet1s256 MBJudgeable
Send me the moneyGiven a pattern string S, decide for each of M notes whether S is a subsequence of the note.Easy3StringTwo pointers+2No attempts yet1s512 MBJudgeable
A+B Without SpacesA string holds two numbers from 1 to 10 with no separator; find a split that makes two valid natural numbers and print their sum.Easy3StringBrute force+1No attempts yet0.5s512 MBJudgeable
A Palindrome Is Not a Palindrome!!Given an uppercase string up to 500,000 characters, find the length of the longest substring that is not a palindrome, or -1 if none exists.Easy3StringImplementation+2No attempts yet2s512 MBJudgeable
Baby Sukhwan Tururu TuruFind the N-th word of a repeating song whose tururu runs grow by one extra ru each repetition, with long runs printed in a compressed form.Easy3ImplementationMath+2No attempts yet1s512 MBJudgeable
Girl Group Master JunseokRead N girl groups with member lists, then answer M quizzes: list a team's members sorted, or name a member's team.Easy3Hash mapSorting+1No attempts yet2s128 MBJudgeable
I Have Few Friends (Small)A textbook text S may contain digits that stand for unknown letters. Decide whether a keyword K (letters only) can match some substring of S, treating each digit as any letter.Easy3StringBrute force+1No attempts yet1s128 MBJudgeable
Variable NamesGiven a variable name in camel, snake, or Pascal case, print its camel, snake, and Pascal forms.Easy3StringImplementationNo attempts yet2s512 MBJudgeable
SpreadsheetsConvert a column index up to 1e9 into a base-26 name like A, Z, AA, using letters with no zero digit.Easy3MathString+2No attempts yet2s512 MBJudgeable
Go LatinTranslate each English word to pseudo-Latin by replacing the suffix per a table, or appending "us" when no listed suffix matches.Easy3StringImplementationNo attempts yet0.5s512 MBJudgeable
ExamGiven two answer strings and how many answers your friend got right, maximize your own possible score over all valid answer keys.Easy3StringGreedy+1No attempts yet2s512 MBJudgeable
EnigmaCount alignments of the crib inside the ciphertext where no crib letter equals the ciphertext letter at the same offset.Easy3StringBrute force+1No attempts yet2s512 MBJudgeable
Season of ReadingReplace WHO, WHERE, and WHAT in each sentence with the given resolving elements, expanding nested references.Easy3StringRecursion+1No attempts yet1s512 MBJudgeable
Grouping Identical WordsCount words that are permutations of each other using letter counts, and print the number of distinct letter multisets.Easy3SortingHash map+1No attempts yet2s512 MBJudgeable
Aligned TypesettingGiven an equal number of spaces between every pair of consecutive words, decide whether one such aligned typesetting has total length exactly L.Easy3StringMath+1No attempts yet2s512 MBJudgeable
Star in ParenthesesGiven balanced parentheses with one star, count the matching pairs that enclose the star's position.Easy3StackString+1No attempts yet2s512 MBJudgeable
Teenage MutantCompare each of your k trait characters against all n ancestor strings at the same position, count positions where yours differs from every ancestor, and output that count over k.Easy3ArrayString+1No attempts yet2s512 MBJudgeable
Strong PasswordGiven a string S, find the minimum number of characters to append so it has length at least 6 and contains a digit, a lowercase letter, an uppercase letter, and a special character.Easy3StringGreedy+2No attempts yet2s512 MBJudgeable
Cellphone Text CompressionFor each of N strings, output its run-length encoding: each maximal run of identical characters as a count followed by the character.Easy3StringImplementation+1No attempts yet1s512 MBJudgeable
LunGiven a card number string with one digit replaced by 'x', find the smallest digit for 'x' that makes the number pass the Luhn check.Easy3ImplementationMath+2No attempts yet1s512 MBJudgeable
Word ClockConvert an hour and minute into the words a word clock shows, using past or to and special phrases for 0, 15, 30, and 45 minutes.Easy3ImplementationString+2No attempts yet0.5s512 MBJudgeable
Integral of a PolynomialParse a degree-at-most-1 polynomial string and print its integral, writing x^2 as xx and the constant of integration as W.Easy3StringImplementation+2No attempts yet1s256 MBJudgeable
The Deeper, The BetterGiven a correct bracket string with digits inside, score each digit by the brackets enclosing it and print the highest score.Easy3StackString+1No attempts yet1s256 MBJudgeable
Only Three!Count how many length-3 windows of a digit string are strictly increasing and are not extended to a run of four or more consecutive digits.Easy3StringImplementation+2No attempts yet1s256 MBJudgeable
Typing PracticeGiven a short sentence, assign each key press (letters plus Shift and space) to the left or right hand under QWERTY rules and balance the counts, letting the left hand press one extra when the difference is one.Easy3StringGreedy+1No attempts yet1s256 MBJudgeable
Claire and PalindromeFill each '?' in a string with a lowercase letter so the whole string becomes a palindrome, printing any valid result.Easy3StringTwo pointers+1No attempts yet1s256 MBJudgeable
Circuit MathEvaluate a valid postfix boolean circuit over up to 26 variables and print T or F for the given input assignment.Easy3StackString+1No attempts yet1s1024 MBJudgeable
Beer BillParse each bill line as either an item price with optional bars or a bars-only rake line, then print the total (beer at 42) rounded up to a multiple of 10 in the N,- format.Easy3ImplementationString+2No attempts yet2s512 MBJudgeable
Strange Cipher CodeSplit a string into case-insensitive runs of equal letters, map each run to 1 if its length is at least K and 0 otherwise, and drop later runs whose letter already appeared.Easy3StringImplementation+2No attempts yet1s1024 MBJudgeable
Issuing PlatesFor each of M plates, decide whether any of N bad words appears as a substring after mapping leetspeak digits to letters.Easy3StringString matching+2No attempts yet1s512 MBJudgeable
Black and WhiteGiven an n by n grid of B and W cells, check that every row and column is balanced and has no three cells of the same color in a row.Easy3ArrayImplementation+2No attempts yet1s512 MBJudgeable
Basketball One-on-OneGiven a string recording who scored and how many points each time, determine which player won the basketball game under the eleven-point and win-by-two rules.Easy3ImplementationSimulation+2No attempts yet1s512 MBJudgeable
Soft PasswordsGiven a stored password S and an entered password P, decide whether P is accepted: equal to S, a digit-prepend/append of S, or the case-reversed form of S.Easy3StringImplementation+2No attempts yet1s512 MBJudgeable
ZOAC 2A disk holds the 26 uppercase letters in a circle, and an arrow starts at 'A'. Find the minimum total rotations needed to print a given string in order.Easy3ImplementationGreedy+2No attempts yet1s512 MBJudgeable
A Cipher in WonderlandFor the i-th line, read the sentence starting at the first character and print every i-th character in order.Easy3StringImplementationNo attempts yet1s512 MBJudgeable
Word ProcessorFormat N words into lines of at most K characters using the greedy first-fit rule, then print the result.Easy3SimulationImplementation+2No attempts yet2s512 MBJudgeable
SECHTDecode a string where each letter was replaced by the uppercase or lowercase form of the character to its left (or lowercase itself if the left is not a letter).Easy3StringImplementationNo attempts yet2s512 MBJudgeable
SENTIRead L comments, each ending with a period, and count how many contain a word from a given positive list and how many contain one from a negative list.Easy3StringImplementation+1No attempts yet2s512 MBJudgeable
New Year and NamingGiven two cyclic string sequences, return the concatenation of the pair selected by each queried year index.Easy3ImplementationMath+2No attempts yet1s1024 MBJudgeable
Time ZoneGiven a time in Beijing (UTC+8) and a target time zone string, print the corresponding 24-hour clock time.Easy3ImplementationMath+2No attempts yet1s256 MBJudgeable
Cyclic ShiftsGiven a text T and a string S, decide whether T contains any cyclic shift of S as a contiguous substring.Easy3StringString matching+2No attempts yet2s512 MBJudgeable
Palindromic FizzBuzzPrint every integer from S to E, replacing any palindromic number with the string Palindrome!.Easy3ImplementationMath+2No attempts yet1s512 MBJudgeable
DatesEach input line is a date in day.month.year or month/day/year format; print both formats, validating that the date actually exists.Easy3ImplementationString+2No attempts yet1s512 MBJudgeable
Counting WordsSplit a sentence on spaces and hyphens, then split any token that looks like a French contraction (c', j', n', m', t', s', l', d', qu' followed by a vowel) into two words, and count the total.Easy3StringImplementation+2No attempts yet2s1024 MBJudgeable
Endless StringStarting from a string A, repeatedly replace every $ in S with the previous result, then print characters from position min to max after N runs.Medium4StringRecursion+2No attempts yet2s128 MBJudgeable
Room NumberGiven digit prices and a budget, find the largest possible room number (no leading zero unless it's just 0) that can be bought within the budget.Medium4GreedyString+1No attempts yet2s128 MBJudgeable
Remote ControlGiven a target channel and a set of broken digit buttons, compute the minimum button presses to reach the channel from 100 using digits, plus and minus.Medium4Brute forceString+2No attempts yet2s256 MBJudgeable
KickdownGiven two gear strings of 1s and 2s, slide one horizontally to minimize the combined width without any overlapping position having a tooth (2) on both.Medium4StringBrute force+1No attempts yet2s128 MBJudgeable
Make a PalindromeRearrange the letters of a given uppercase string into the lexicographically smallest palindrome, or report it is impossible.Medium4StringGreedy+1No attempts yet2s128 MBJudgeable
Enormous Wealth 2Given two huge decimal integers n and m (up to 10^1000), compute the quotient and remainder of dividing n by m using big-integer division.Medium4MathString+1No attempts yet2s128 MBJudgeable
Lucky StringsCount the distinct rearrangements of a short string (length up to 10) that have no two adjacent equal characters.Medium4BacktrackingCombinatorics+1No attempts yet2s256 MBJudgeable
PolyominoCover every run of X cells with 2-cell (BB) and 4-cell (AAAA) blocks and print the lexicographically smallest resulting board, or -1 if some run has odd length.Medium4GreedyString+2No attempts yet2s128 MBJudgeable
Text EditorSimulate a line editor with cursor movement, character deletion, and insertion commands, printing the final string.Medium4StackSimulation+2No attempts yet0.3s512 MBJudgeable
Similar WordsCount unordered pairs of equal-length words that are related by some bijection between letters, similar to the isomorphic-strings check.Medium4StringHash map+1No attempts yet2s128 MBJudgeable
FlippingGiven a binary string, find the minimum number of contiguous-segment flips needed to make all characters equal.Medium4StringGreedy+1No attempts yet2s128 MBJudgeable
English ReadingCount how many dictionary-word combinations match each scrambled sentence when each word's middle letters can be permuted freely.Medium4Hash mapString+2No attempts yet2s128 MBJudgeable
BishopGiven board size N as a big number up to 70 digits, compute the maximum bishops placeable on an N by N board without mutual attacks, which is 2N-2 (or 1 if N=1).Medium4MathString+1No attempts yet2s128 MBJudgeable
Perfect Attendance AwardCount length-N attendance strings over O, L, A that have at most one L and no three consecutive A's, modulo 1,000,000.Medium4Dynamic programmingString+1No attempts yet2s128 MBJudgeable
Glyph DecodingCount how many length-g substrings of S are letter-for-letter rearrangements of a given word W.Medium4Sliding windowString+1No attempts yet2s128 MBJudgeable
Minsik Language Word SortingSort Minsik language words using a custom 20-letter alphabet where the digraph 'ng' counts as a single letter between 'n' and 'o'.Medium4StringSorting+1No attempts yet2s128 MBJudgeable
Decompressed String LengthCompute the total length of a string after fully expanding nested K(Q) compression patterns, where K is a single digit repeat count.Medium4StackString+1No attempts yet2s128 MBJudgeable
String SearchImplement KMP string matching to count and list all 1-indexed starting positions where pattern P occurs in text T of length up to 1,000,000.Medium4String matchingStringNo attempts yet2s256 MBJudgeable
Postfix NotationConvert a fully parenthesized-or-not infix arithmetic expression with single-letter operands into its postfix notation.Medium4StackStringNo attempts yet2s128 MBJudgeable
LCS of Three StringsCompute the length of the longest common subsequence shared by three given strings using dynamic programming.Medium4Dynamic programmingStringNo attempts yet2s128 MBJudgeable
Chemistry 101Parse a chemical equation with molecule multipliers and element counts, then report which elements differ in count between reagents and products.Medium4StringHash map+1No attempts yet1s128 MBJudgeable
Decode CountCount the number of ways to decode a digit string into letters A-Z, modulo 1,000,000.Medium4Dynamic programmingStringNo attempts yet2s128 MBJudgeable
Exponential OperationPrint the exact decimal expansion of 1/2^N without trailing zeros, for N up to 250, using big-number arithmetic.Medium4MathImplementation+1No attempts yet2s8 MBJudgeable
Digital ClockGiven a broken 5x3 segment display for four digits where lit cells are always correct but some are missing, find the earliest valid hh:mm time consistent with the pattern.Medium4Brute forceImplementation+1No attempts yet2s128 MBJudgeable
Transaction Limit CheckingParse bank customer, account, and transaction records to validate ownership and per-day, per-type transaction and exposure limits, printing a result per instruction.Medium4Hash mapSimulation+1No attempts yet1s128 MBJudgeable
Cipher DecryptionGiven a key and ciphertext produced by a columnar transposition cipher, reconstruct the original plaintext.Medium4StringSimulation+1No attempts yet2s128 MBJudgeable
Writing Consecutive Numbers 3Given N, find the earliest 1-based index where the digit-string of N occurs inside the concatenation of integers 1 through N.Medium4String matchingString+1No attempts yet2s128 MBJudgeable
Custom Table SorterRead tables and per-line sort specifications, then output the table rows stably sorted by given field/direction keys for each specification, grouped and formatted with blank lines.Medium4SortingString+1No attempts yet1s128 MBJudgeable
String Alignment ScoreCompute the maximum scoring alignment of two strings using gap and mismatch/match scoring, which is a classic sequence alignment (edit distance style) DP.Medium4Dynamic programmingStringNo attempts yet2s128 MBJudgeable
Chemical Formula MassParse a chemical formula with nested parentheses and digit multipliers to compute the total atomic mass using H=1, C=12, O=16.Medium4StackString+1No attempts yet2s128 MBJudgeable
Large Integer ArithmeticCompute the sum, difference, and product of two signed integers up to 1000 digits without built-in bignum support.Medium4MathString+1No attempts yet2s128 MBJudgeable
Large Number CalculationParse and evaluate an arithmetic expression with big integers up to 10^100, respecting operator precedence and floor division for negatives.Medium4MathString+1No attempts yet2s128 MBJudgeable
Hamming PathBuild a graph where binary codes connect if their Hamming distance is 1, then output a shortest path between two given codes via BFS.Medium4BFSGraph+1No attempts yet1s128 MBJudgeable
Bracket ValueParse a bracket string with two bracket types and compute its defined nested value, or output 0 if it is invalid.Medium4StackString+1No attempts yet1s128 MBJudgeable
Number CardsCount the ways to split a digit string into tokens each representing a valid card number from 1 to 34 (no leading zero issues implied).Medium4Dynamic programmingStringNo attempts yet1s128 MBJudgeable
Drawing PolygonsGiven a reference closed-path digit sequence tracing a polygon, find which candidate sequences represent the same polygon allowing rotation of starting point and direction reversal but not geometric rotation or reflection.Medium4String matchingString+1No attempts yet1s128 MBJudgeable
FaxImplement run-length encoding with specific bit-packed run and literal prefix formats, splitting long runs and literal blocks according to size limits.Medium4SimulationString+2No attempts yet1s128 MBJudgeable
Next Greater NumberGiven a large number as a digit string, find the smallest permutation of its digits that is greater than it, or report BIGGEST if none exists.Medium4StringGreedy+1No attempts yet1s128 MBJudgeable
Chip Stack ShuffleSimulate repeated riffle shuffles of two chip stacks and find the minimum number of shuffles to reach a target stack, or report -1.Medium4SimulationStringNo attempts yet1s128 MBJudgeable
Horizontal and Vertical PuzzleGiven 6 three-letter words, choose 3 as rows and 3 as columns so the grid's columns also match the remaining words, outputting the lexicographically smallest valid arrangement.Medium4Brute forceString+1No attempts yet1s128 MBJudgeable
Infinite Binary Tree TraversalGiven a string of L/R/P/* moves in an infinite binary tree, sum the node values over all traversals from expanding each '*' into L, R, or P.Medium4MathString+1No attempts yet1s128 MBJudgeable
Quiz HintsGenerate three progressive hint strings for a text answer by masking letters with dots and revealing them in stages based on rounded fractional counts.Medium4StringSimulation+1No attempts yet1s128 MBJudgeable
Urinal Flush ScheduleSimulate a sensor log to detect when a urinal usage streak of K seconds is followed by an absence streak of L seconds, printing each flush time or NIKAD.Medium4SimulationString+1No attempts yet1s128 MBJudgeable
Programming Language ZParse and simulate a tiny toy language with variable assignments, nested REPEAT loops, and PRINT statements, applying mod-10000 arithmetic.Medium4SimulationImplementation+1No attempts yet2s128 MBJudgeable
String Expansion and DistanceCompute the minimum alignment cost between two strings using edit-distance style dynamic programming with character mismatch costs and a fixed gap penalty K.Medium4Dynamic programmingStringNo attempts yet1s128 MBJudgeable
Molecular MassParse a nested chemical formula with parentheses and repeat counts, then compute the total molecular mass from atomic weights.Medium4StackRecursion+1No attempts yet1s128 MBJudgeable
Radio TransmissionGiven a received string that is part of a repeated broadcast, find the length of the shortest repeating unit using KMP failure function.Medium4String matchingStringNo attempts yet1s128 MBJudgeable
The VowDetermine, for each word and up to length 50000, whether it can be split into a sequence of one or two letter chemical element symbols using DP.Medium4Dynamic programmingStringNo attempts yet1s128 MBJudgeable
HeadshotGiven a circular string of loaded/empty chambers, decide whether shooting immediately or re-spinning gives a lower chance of firing given the previous chamber was empty.Medium4StringProbability+1No attempts yet1s128 MBJudgeable
iSharpParse a C-like multi-variable type declaration with pointer, reference, and array symbols, then print each variable on its own line with its symbols moved to the front in reversed order.Medium4StringImplementation+1No attempts yet1s128 MBJudgeable
Access Control ListsParse an ordered ACL of allow/deny IP network rules and, for each query IP, output whether the first matching rule grants or denies access.Medium4Bit manipulationString+2No attempts yet3s256 MBJudgeable
Important WiresParse boolean formulas over up to 11 wires and count distinct output tuples across all wire assignments by brute-force enumeration.Medium4StringBit manipulation+1No attempts yet3s256 MBJudgeable
Search by templateParse a pattern with literal letters, wildcards, and allow/forbid letter groups, then find all positions where it matches inside a large text.Medium4String matchingString+1No attempts yet2s128 MBJudgeable
CalculatorParse and evaluate fully parenthesized arithmetic expressions with big integers up to 90 digits, printing Error on overflow, negative results, or division by zero.Medium4StringMath+2No attempts yet1s128 MBJudgeable