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 results575 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Name GeneratorSplit a string into k different non-empty consecutive parts, or report that no such split exists, choosing the lexicographically smallest sequence. | Medium5 | StringGreedy+1 | No attempts yet | 2s | 256 MB | Judgeable |
| ABCDEGiven an undirected friendship graph, decide whether it contains a simple path of five distinct vertices, that is, a path with four edges. | Medium5 | GraphDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Smallest sum no subsequence can makeGiven N ≤ 20 numbers, find the smallest natural number that is not the sum of any non-empty subsequence. | Medium5 | BacktrackingBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| BFFs (Small)Find the largest subset of kids that can be arranged in a circle so each kid sits next to their BFF. | Medium5 | GraphBrute force+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Paper PiecesCut an N x M digit grid into horizontal or vertical strips and maximize the sum of the numbers those strips form. | Medium5 | Brute forceBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Flower PathPlace three plus-shaped flowers of 5 cells each on an N x N grid so no two overlap, all stay inside, and the total rented-cell cost is minimal. | Medium5 | Brute forceBacktracking+2 | No attempts yet | 2s | 256 MB | Judgeable |
| SlurpyDecide whether each uppercase string is a Slurpy, meaning a Slimp immediately followed by a Slump, where both are defined by recursive grammar rules. | Medium5 | RecursionString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Connect3Given Black's opening column x and White's winning square (a,b), count final 4x4 board states where White's move there completes three in a row first. | Medium5 | BacktrackingSimulation+1 | No attempts yet | 0.5s | 512 MB | Judgeable |
| CCTV Blind SpotsPlace each of up to 8 cameras in one of its allowed rotations on an 8x8 grid so that the fewest cells stay unwatched, given walls block sight. | Medium5 | Brute forceBacktracking+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Jumping King Jelly (Small)Given an N by N board with jump numbers, move only right or down from the top-left and reach the bottom-right, or report failure. | Medium5 | DFSBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Two DotsGiven a grid of colored dots, decide whether any cycle of four or more same-colored dots exists, where consecutive dots touch by an edge. | Medium5 | DFSGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| The Great Revegetation (Bronze)Assign each of N pastures one of 4 grass types so that every listed pair differs, choosing the lexicographically smallest N-digit answer. | Medium5 | GraphGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ⚾Given each of 9 players' predetermined results over N innings, choose a batting order with player 1 batting 4th to maximize total runs scored. | Medium5 | Brute forceSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Building a Large NumberGiven N and a digit set K (size 1 to 3), find the largest number at most N whose digits all come from K. | Medium5 | GreedyBacktracking+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Decreasing NumberGiven N, find the N-th smallest non-negative integer whose digits strictly decrease from left to right, or output -1 if none exists. | Medium6 | CombinatoricsGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Word PuzzleCount how many words from a fixed dictionary can be spelled by paths of adjacent, non-repeating cells in a 5x5 letter grid. | Medium6 | TrieBacktracking+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Student ShuffleCount permutations of up to 16 students so that every pair of adjacent heights differs by more than a given value K. | Medium6 | Dynamic programmingBit manipulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Composite PrimeGiven up to 1e5 queries with N as large as 10^7, find the largest composite number at most N whose every proper contiguous digit substring of length 2 or more is prime. | Medium6 | BacktrackingMath+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Shom SquareConstruct the lexicographically smallest N by N grid using digits 0 to D-1 so every row and column contains all D values at least once. | Medium6 | BacktrackingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Number Connection PuzzleFind a Hamiltonian path on an m by n grid (both even, up to 8) connecting two given endpoints, moving only to adjacent cells without crossing itself, or report -1. | Medium6 | BacktrackingGraph+1 | No attempts yet | 5s | 128 MB | Judgeable |
| Sum of Lucky NumbersWrite N as a sum of the fewest numbers made only of digits 4 and 7, breaking ties by the lexicographically smallest sequence. | Medium6 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Anti-PalindromeRearrange all characters of a string to form the lexicographically smallest anti-palindrome, where each pair of symmetric positions must differ, or report impossible. | Medium6 | GreedyString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Making PrimesCombine all N (up to 6) given numbers with +,-,*,/ and parentheses in every possible way to find the smallest and largest prime value obtainable. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Box PuzzlePlace n^2 rotatable cube boxes into an n by n grid so touching side faces match and outward faces show 0, then output the arrangement and rotation counts. | Medium6 | BacktrackingMatrix+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Finding the Maximum Score PathFind the maximum-score simple path from the top-left to bottom-right cell of an N x N grid moving only in four directions without revisiting cells. | Medium6 | BacktrackingDFS+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Restoring Calculation ExpressionsInsert +, -, or * between digits of a string (length up to 9, no leading zero numbers) to produce all expressions evaluating to 2000, sorted lexicographically. | Medium6 | BacktrackingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SudokuSolve a given 9x9 Sudoku puzzle via backtracking and output the lexicographically smallest completed board if multiple solutions exist. | Medium6 | BacktrackingMatrix+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Nonlinear SequencesCount and list increasing length-L sequences from 1..M containing no three-term arithmetic progression, printing the first three lexicographically and the total count. | Medium6 | BacktrackingCombinatorics+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Wireless Communication Base StationsAssign positive integer frequencies to at most 12 base stations so adjacent stations (within distance 20) differ by at least 2, minimizing the count of distinct frequencies used. | Medium6 | BacktrackingGraph+1 | No attempts yet | 2s | 128 MB | Judgeable |
| SudokuSolve a standard 9x9 sudoku puzzle by filling empty cells so every row, column, and 3x3 box contains digits 1 through 9, using backtracking search. | Medium6 | BacktrackingMatrix+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Restoring Equal-Length SticksGiven stick pieces, find the smallest common stick length so all pieces can be partitioned into groups summing to that length, and output the grouping. | Medium6 | BacktrackingMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Good SequenceConstruct the lexicographically smallest square-free string of length N over the alphabet {1,2,3} (no two adjacent equal-length substrings identical). | Medium6 | GreedyString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 24 Matchstick PuzzleGiven N and K, remove exactly N matchsticks from a 3x3 grid of 24 matchsticks so that exactly K complete squares remain and every leftover stick belongs to some square. | Medium6 | BacktrackingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Password Name FinderFind the minimum set of 2 to 5 distinct girl names of length 3 to 8 whose pairwise concatenations reconstruct all given passwords. | Medium6 | StringBacktracking+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bar CodeReconstruct the unique binary digit sequence from a partially unreadable bar code grid of black/white/unknown squares, or report it cannot be determined. | Medium6 | BacktrackingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Galaxy InterconnectionGiven a low-degree graph with a proper k-coloring, output -1 if any edge shares a color, otherwise count vertices that start a simple path of k vertices visiting all k colors. | Medium6 | GraphDFS+1 | No attempts yet | 3s | 256 MB | Judgeable |
| 16x16 SudokuSolve a given 16x16 Sudoku puzzle so each row, column, and 4x4 box contains letters A to P exactly once, given a unique solution exists. | Medium6 | BacktrackingMatrix+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Enjoyable CommunicationFind the k-th shortest simple path (by length then lexicographic node order) between two nodes in a directed graph with up to 50 nodes and k up to 200. | Medium6 | Shortest pathGraph+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Starting LineupAssign 11 players to 11 positions, each with ability 0 to 100, maximizing total ability while avoiding zero-ability slots; every player suits at most 5 positions. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CranesChoose a subset of at most 15 crane locations, each with a radius, so that every pair's distance exceeds the sum of radii, maximizing the total squared radius. | Medium6 | Brute forceGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Build a Square from SticksGiven up to 20 stick lengths, decide whether all sticks can be split into four groups of equal total length. | Medium6 | BacktrackingRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| No TippingCount the orders in which n packages can be removed from a lever on two fulcrums so the board never tips. | Medium6 | BacktrackingBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pride and Prejudice and ZombiesFor each number up to 18 digits, decide whether its digits split into two equal-length factors with no leading or consecutive zeros. | Medium6 | Brute forceBacktracking+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BounceFind the shortest non-self-intersecting path on a hex grid from the top row to the bottom and back to the top row on the right, whose letters form a repeated pattern of given length. Example | Medium6 | DFSBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Don't Get RookedFind the maximum number of non-attacking rooks on a board up to 4x4 where walls block rook attacks. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Puzzling ProblemPlace up to 5 fixed-orientation polyomino pieces, each labeled by index, to tile a 4x4 square exactly, printing the lexicographically smallest labeled grid or a failure message. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Curling 2.0On a grid with destructible blocks, find the fewest throws to slide a curling stone from start to goal, where each slide continues until it hits a block or leaves the board. | Medium6 | DFSBacktracking+2 | No attempts yet | 3s | 128 MB | Judgeable |
| New FriendsGiven up to 10 town names, partition them into the fewest groups where every pair of names in a group differ by at most one Levenshtein edit (case ignored). | Medium6 | StringGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Shut the Box IIGiven open cards and a rolled total, pick the set summing to the total that maximizes the probability of shutting every card under optimal play, and report that probability. | Medium6 | Dynamic programmingBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Report RecoveryRebuild a space-stripped sales report by splitting each digit run into numbers, choosing the lexicographically smallest reconstruction consistent with the report's structure. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Fridge LockGiven K rings each showing 3 to 49 positive integers and K linear equations, pick one number per ring satisfying all equations and print the selection. | Medium6 | Brute forceMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| HorseshoesOn an N x N grid (N at most 5) of parentheses, find the longest walk from the top-left cell, visiting each cell at most once, whose collected characters form a run of '(' followed by an equally long run of ')'. | Medium6 | DFSBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Connect the CowsCount the axis-parallel tours from the origin that turn exactly once at each of N (at most 10) given cow positions before returning to the origin. | Medium6 | BacktrackingGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| New Cow BrandsGiven each position's allowed distinct letters, list the codes ranked from start to finish in lexicographic order, where no letter repeats inside a code. | Medium6 | BacktrackingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Plato's BlocksGiven three n by n shadow patterns, decide whether one connected solid built from unit cubes can cast all three shadows simultaneously. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AnagramFor each given word, print every distinct string formed by rearranging its letters, in lexicographic order with duplicates removed. | Medium6 | BacktrackingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| European railroad tracksGiven up to 8 distinct gauge lengths, find the smallest number of points on a line such that every gauge appears as a distance between two points. | Medium6 | Brute forceBacktracking+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Even a Kindergartner Could Solve ThisDecide whether each string over the alphabet {, }, and comma is a valid set by the given grammar, where brace characters can be either delimiters or atoms. | Medium6 | StringDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| A Model RailroadPlace a non-self-crossing path of straight and curved rails in a small grid from a bottom connection to a top connection, maximizing the number of cells used. | Medium6 | DFSBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Game Show MathInsert +, -, *, / between the given numbers in order, left to right, so the running value hits the target; output the smallest expression or NO EXPRESSION. | Medium6 | DFSBacktracking+1 | No attempts yet | 2s | 128 MB | Judgeable |
| World CupGiven win/draw/loss records for 6 nations in a round-robin group, decide for each of four cases whether some assignment of the 15 match results produces those records. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Letter GameGiven up to 7 collected letters and a dictionary, find all words or pairs of words with the maximum total letter-value score, using each collected letter at most as often as it appears. | Medium6 | StringHash map+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Heating MainCount the ways to lay a single non-crossing path of four fixed pipe shapes from the top-left top side to the bottom-right right side, respecting fixed pipes and blocked garden cells on a grid of at most 10 by 10. | Medium6 | BacktrackingDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Prime ScrabbleGiven up to 8 digit tiles, choose a placement order and direction to maximize the sum of prime-reading sums earned minus the values of unplaced tiles. | Medium6 | Brute forceMath+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Algarvu-ScrabbleGiven up to 8 digit tiles, place them one by one at either end of a row to maximize prime-direction scoring minus penalties for unused tiles. | Medium6 | BacktrackingBrute force+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Puzzle of NumbersGiven three digit-and-star patterns for A, B, and C with A + B = C, fill the stars to build the smallest valid equation. | Medium6 | BacktrackingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Operator SignsInsert + or - between adjacent numbers so the left-to-right value equals the target, keeping every partial result within 10000, and print the lexicographically smallest expression. | Medium6 | Dynamic programmingBacktracking+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Flip GameFind the minimum number of flips to turn all 16 pieces white or all black, where each move flips a chosen cell and its orthogonal neighbors. | Medium6 | Brute forceBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Beth TableauxParse a propositional formula and either report it valid or print the lexicographically smallest falsifying assignment. | Medium6 | BacktrackingImplementation+2 | No attempts yet | 2s | 64 MB | Judgeable |
| A Knight's JourneyFind the lexicographically smallest knight's tour that visits every square of a rectangular board with at most 26 squares exactly once. | Medium6 | BacktrackingDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Dory's PhonebookGiven a dictionary of words and a phone number, find every encoding of the number as a space-separated sequence of dictionary words, sorted lexicographically. | Medium6 | TrieBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SudokuFill every empty cell of a 9x9 Sudoku grid so each row, column, and 3x3 box contains the digits 1 through 9 exactly once. | Medium6 | BacktrackingMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| Water pipeConnect two points with axis-aligned pipe segments of given lengths and counts, turning only 90 degrees, and minimize the number of segments used. | Medium6 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BackpackChoose a set of items whose total mass is at most p, where each chosen item requires its named lower-indexed prerequisite to be chosen too. | Medium6 | Dynamic programmingTree+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Pattern LockGiven the unit-segment graph left by an Android pattern, find a valid pattern of at least four dots that draws exactly it. | Medium6 | BacktrackingGraph+1 | No attempts yet | 3s | 128 MB | Judgeable |
| LeetDecide whether the plain word can be split so each distinct letter maps to one fixed leet block of length at most k. | Medium6 | BacktrackingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| KTXDecide whether a departure permutation can be reordered into ascending grade order using a direct main line and two LIFO bypass tracks. | Medium6 | StackBacktracking+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Who needs 8 queens when you can have N?Find the lexicographically smallest placement of N non-attacking queens on an N by N board for each test case. | Medium6 | BacktrackingRecursion+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Jill's Tour PathsList every simple route from the start village to the destination within the distance limit, ordered by length then village order. | Medium6 | BacktrackingDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BoggleFind all dictionary words on each 4x4 Boggle board with 8-direction steps without reuse, then report the total score, longest word, and word count. | Medium6 | TrieDFS+1 | No attempts yet | 10s | 512 MB | Judgeable |
| Powerbase FormatCount how many integers in each query range lack a powerbase form d1^1+...+dL^L within the length bound using the given digits. | Medium6 | BacktrackingDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Suspicious OrdersCount the cliques in a network of up to 20 people whose combined ordered items cover at least one of the given attack combinations. | Medium6 | BacktrackingBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Breaking the EquationsPick twelve values from the given set that satisfy the six addition equations and form the lexicographically smallest tuple. | Medium6 | Hash mapBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| WormholesCount the pairings of N wormholes into pairs so that walking right and teleporting through pairs can loop forever from some start. | Medium6 | BacktrackingGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bowling Score AssistantGiven eight frames of bowling scores and the rival total, find the lexicographically smallest rolls in frames 9 and 10 that win, or report impossible. | Medium6 | BacktrackingSimulation+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Loopy transitCount distinct directed simple cycles in a graph of up to 9 stations, treating rotations of a loop as one. | Medium6 | GraphBacktracking+1 | No attempts yet | 2s | 256 MB | Judgeable |
| TowersFill an n by n Latin square with heights 1 to n that matches fixed cells and border visibility counts, printing the smallest solution or no. | Medium6 | BacktrackingBrute force | No attempts yet | 10s | 256 MB | Judgeable |
| ZGODANGiven a non-handsome integer with up to 1000 digits, find the nearest integer whose consecutive digits alternate between even and odd, printing both on a tie. | Medium6 | GreedyString+1 | No attempts yet | 1s | 32 MB | Judgeable |
| CarpetsDecide whether the given carpets, each usable rotated, cover a W by H room exactly with no overlap. | Medium6 | BacktrackingRecursion | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball Championship Team AssignmentAssign n players to the fewest teams so no rival pair shares a team, breaking ties by lexicographically smallest team numbers. | Medium6 | BacktrackingGraph+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball team divisionColor up to 14 players with the fewest teams so rivals differ, breaking ties by the smallest team-number sequence. | Medium6 | GraphBacktracking+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Black ViennaCount the three-suspect sets that can form the hidden circle while matching every investigation reply about the two players' hands. | Medium6 | Brute forceBacktracking | No attempts yet | 1s | 256 MB | Judgeable |
| Kimagure CleanerFill in the forgotten turns and pick each run length inside its range so the cleaner ends at (X, Y), printing the smallest such log. | Medium6 | BacktrackingMath | No attempts yet | 10s | 1024 MB | Judgeable |
| Password-free alphabet arrangementArrange A to Z in one row so none of the given passwords appears as a contiguous block, choosing the smallest such order or reporting impossibility. | Medium6 | BacktrackingString matching+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Paper folding 2Fold a 6 by 6 or smaller number grid along grid lines so overlapping cells add up, and maximize the value held in one cell. | Medium6 | BacktrackingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Power Swapper (Small)Count the ordered swap sequences that sort the permutation when each block size is used at most once on aligned ranges. | Medium6 | BacktrackingBrute force+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Symmetric Trees (Small)Decide whether a colored tree with at most 12 vertices admits a planar straight-line drawing with a vertical line of symmetry. | Medium6 | Brute forceTree+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Crime House (Small)Assign each masked passage to a person so inside and outside states stay valid and report the smallest possible final occupancy, or CRIME TIME. | Medium6 | BacktrackingSimulation | No attempts yet | 5s | 512 MB | Judgeable |
| The Bored Traveling Salesman (Small)Choose a start city and a depth-first ticket tour of the graph so the concatenated first-visit ZIP codes form the smallest number. | Medium6 | BacktrackingDFS+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Can't Stop (Small)Find the longest consecutive run of roll sets where every set contains at least one of k chosen numbers. | Medium6 | Sliding windowBacktracking | No attempts yet | 5s | 512 MB | Judgeable |