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 |
|---|---|---|---|---|---|---|
| Letter ArithmeticAssign distinct digits to letters so that each given letter word plus a second equals a third, then print the three numeric values. | Medium7 | BacktrackingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TripGiven two strings, print all longest common subsequences in lexicographic order without duplicates. | Medium7 | Dynamic programmingBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PuzzlestanGiven N groups of M lettered items and statements about which items share or do not share an owner, reconstruct the full assignment of items to guests. | Medium7 | Union-findBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Destroying SquaresGiven an n x n matchstick grid (n <= 5) with some sticks already removed, find the minimum number of additional sticks to remove so that no square remains complete. | Medium7 | BacktrackingBit manipulation+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Lattice AnimalsCount free n-polyominoes (up to rotation and reflection) that fit inside a w by h rectangle, with n up to 10. | Medium7 | BacktrackingBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Queen KingdomOn an n by n board with pillars blocking queens' attacks, find the maximum number of non-attacking queens and the number of placements attaining it. | Medium7 | BacktrackingBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| MinesweeperGiven a partially revealed Minesweeper grid, mark each unrevealed cell as definitely a mine, definitely safe, or undetermined across all consistent arrangements. | Medium7 | BacktrackingBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| Fighting for TrianglesOn a triangular board with some edges already drawn, two players alternate adding edges, claiming a unit triangle when their edge completes it. Decide the winner with optimal play. | Medium7 | Game theoryGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Roman CorridorFind a left-to-right path through the grid whose symbol string is a valid Roman numeral and has the smallest decimal value. | Medium7 | DFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Vase CollectionGiven up to 100 shape-decoration pairs drawn from a 36 by 36 grid, find the largest k for which some k shapes and k decorations form a complete k by k block of owned pairs. | Medium7 | Brute forceBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Violet Jigsaw PuzzleCount how many ways to place and rotate the given pieces into an n by m rectangle so that all touching sides match tab-to-blank and border sides are flat. | Medium7 | BacktrackingImplementation+1 | No attempts yet | 5s | 128 MB | Judgeable |
| Mastermind IIGiven c codes and their A/B compatibility scores with a hidden code of length c, find the lexicographically smallest code consistent with all scores. | Medium7 | Brute forceBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AllianceGiven a bipartite graph, pick the smallest set of edges so that every vertex which has any edge has at least one chosen incident edge. | Medium7 | GraphGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Truncatable PrimesCount integers in [a, b] whose every prefix from the left is prime. | Medium7 | BacktrackingNumber theory | No attempts yet | 1s | 512 MB | Judgeable |
| Jigsaw PuzzleGiven each piece's unordered neighbor list and the first two pieces of the top row, reconstruct the N by M puzzle grid or report that it is not unique. | Medium7 | BacktrackingGraph | No attempts yet | 1s | 128 MB | Judgeable |
| Up a TreeGiven three garbled preorder, inorder and postorder outputs from mixed-up recursive calls, list every call assignment and the smallest tree that fits each one. | Medium7 | TreeBacktracking+2 | No attempts yet | 6s | 128 MB | Judgeable |
| Lost ListsRebuild the lexicographically smallest increasing list of distinct positive integers matching each sorted pairwise sum list, or print -1 when none exists. | Medium7 | BacktrackingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Subway MapDecide whether every station label fits above or below the line covering its own station point and no other, with no two labels overlapping. | Medium7 | BacktrackingGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| HomeworkChoose the phone call order that lets all N students finish their homework in the shortest time. | Medium7 | BacktrackingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Disperse!Count the ways to split an N by N grid into two congruent halves along cell edges with perimeter exactly M. | Medium7 | CombinatoricsGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Box TopplingDecide if every standing box on an n by n floor can be toppled flat in some order and direction without leaving the floor or overlapping. | Medium7 | BacktrackingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Movie Theater SeatingDecide whether S solo guests and C couples fit into R rows of 8 seats with reserved seats while keeping neighbors and front seats empty. | Medium7 | Dynamic programmingBit manipulation+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Royal GemsFill each cell of an n by m board with one of four gems to maximize the ruby count while every ruby, emerald, and sapphire neighbors the required higher gems. | Medium7 | Dynamic programmingBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Letter CubesGiven words that a set of letter cubes can spell, deduce which six letters sit on each cube. | Medium7 | BacktrackingGraph | No attempts yet | 1s | 128 MB | Judgeable |
| Triangulation and Triangle CountsDecide whether a number sequence matches the per-vertex triangle counts of some polygon triangulation and print its triangles. | Medium7 | BacktrackingGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Treasure ChestsOpen up to 12 treasure chests in the order that leaves the most keys, spending colored keys before wild ones to fill each lock. | Medium7 | Dynamic programmingBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Holodeck HackingCount the positive integers X whose sum with their digit reversal equals the given Y. | Medium7 | BacktrackingMath | No attempts yet | 2s | 128 MB | Judgeable |
| VivoParc Animal AssignmentAssign one of four species to each of up to 100 enclosures so visible pairs differ, and print the lexicographically smallest valid assignment. | Medium7 | BacktrackingGraph | No attempts yet | 1s | 128 MB | Judgeable |
| Young diagrams and Young tableauxCount the fillings of the given Young diagram with numbers 1 to N that rise weakly across rows and strictly down columns. | Medium7 | Dynamic programmingCombinatorics+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Plastic BagsPack every item weighing up to 2000 grams into capacity limited bags, including one free bag set by total price, at the lowest extra cost. | Medium7 | BacktrackingBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| JawbreakRemove groups of at least 3 same-coloured connected balls to maximize the sum of squared group sizes plus a 1000 point clearing bonus. | Medium7 | BacktrackingSimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| PairPair up equal digits on a board of at most 5 by 5 through empty squares to remove the most pairs with the smallest total path length. | Medium7 | BacktrackingBFS+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Magic SquareFill the empty cells with the unused numbers from 1 to N squared so every row, column, and both diagonals share one sum. | Medium7 | BacktrackingBrute force+1 | No attempts yet | 2s | 1024 MB | Judgeable |
| Clearing an N×M BoardRoll a ball that slides until blocked on a board with obstacles and find the fewest slides that visit every empty square. | Medium7 | BacktrackingBFS+1 | No attempts yet | 3s | 256 MB | Judgeable |
| DominosaReconstruct the domino tiling of an n by n+1 grid where each unordered symbol pair appears exactly once. | Medium7 | BacktrackingBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| Missing Piece 2001Decide whether a sliding-tile board reaches a target layout within N moves and report the smallest such move count. | Medium7 | BacktrackingBFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Basin City SurveillanceDecide whether k vertices can be chosen so no two are adjacent in a graph of degree at most four. | Medium7 | BacktrackingGraph+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Key to KnowledgeReconstruct the true-or-false key of up to 30 questions from each student's answers and score, printing the unique key or the count of matching keys. | Medium7 | BacktrackingBrute force+1 | No attempts yet | 10s | 256 MB | Judgeable |
| Three SquaresFind the smallest integer side length so that three equal axis-aligned squares placed on integer grid lines cover all given points. | Medium7 | Binary searchBacktracking | No attempts yet | 3s | 256 MB | Judgeable |
| Can't stop playingStick each arriving power-of-two block to the left or right end, merge equal neighbours, and report if one block can remain with the smallest direction string. | Medium7 | Dynamic programmingBit manipulation+2 | No attempts yet | 10s | 256 MB | Judgeable |
| Guillotine Card GameCompute each player's final score in a three-player card game where one player secretly plays to minimize another player's score. | Medium7 | Game theoryBacktracking+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Quarantine Station PlacementPlace quarantine stations on the fewest islands so every liner touches a station, or report that K stations cannot cover all liners. | Medium7 | BacktrackingGraph | No attempts yet | 10s | 512 MB | Judgeable |
| Calvinball championship, againColor n players with the fewest teams so no disliking pair shares a team, breaking ties by the lexicographically smallest assignment. | Medium7 | BacktrackingGraph+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball team splitSplit up to 16 players into the fewest teams with no disliked pair sharing a team, breaking ties by the smallest assignment sequence. | Medium7 | GraphBacktracking+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball team assignmentColor a graph of up to 15 players with the fewest colors so no dislike edge shares a color, printing the lexicographically smallest assignment. | Medium7 | GraphBacktracking+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball team assignmentAssign up to 24 participants to the fewest teams so no disliking pair shares a team, and print the lexicographically smallest optimal assignment. | Medium7 | BacktrackingGraph+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball minimum teamsSplit up to 20 players into the fewest teams with no disliking pair together, breaking ties lexicographically. | Medium7 | BacktrackingGraph+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball team assignmentColor up to 15 players with the fewest teams so no disliking pair shares a team, breaking ties by lexicographic order. | Medium7 | BacktrackingGraph+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball championship team splitColor up to 16 players with the fewest teams so no disliking pair shares a team, and print the lexicographically smallest optimal assignment. | Medium7 | BacktrackingGraph+1 | No attempts yet | 7s | 512 MB | Judgeable |
| Resistance Is (Not) Futile!Pick the fewest E-12 resistors whose sum is within 1 percent of the voltage over current, breaking ties by closeness. | Medium7 | BacktrackingGreedy+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Inverse Divisor SumsPrint every integer M whose divisor sum equals the given N in increasing order, or none when no such number exists. | Medium7 | BacktrackingNumber theory+1 | No attempts yet | 3s | 256 MB | Judgeable |
| AvoiderCount self-avoiding walks of each length from a to b in the first quadrant starting east from the origin and print the sum. | Medium7 | BacktrackingDFS+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Billiards SortingBall 1 moves through the triangular rack by swapping with a touching ball above or below, and the task asks for the fewest swaps that sort up to 15 balls. | Medium7 | BFSGraph+1 | No attempts yet | 7s | 512 MB | Judgeable |
| JAG-channel IIFind the lexicographically smallest member posting order consistent with the recorded top-to-bottom thread picks under move-to-front reordering. | Medium7 | BacktrackingSimulation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Sprinkler layoutSara tiles her fenced farm with tromino sprinklers around scarecrows using at most as many fence holes as fields. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| WateringTile each 5x5 field with tromino sprinklers following the snake-order procedure and label them greedily with letters a to z. | Medium7 | BacktrackingImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Namuk's Rotten Egg TrayPlace up to K nonoverlapping domino covers on an N by N tray to hide the most rottenness and report the remaining sum. | Medium7 | BacktrackingSorting+1 | No attempts yet | 4s | 512 MB | Judgeable |
| Elf Tournament LineupDecide whether 2^N elves can be lined up for a knockout tournament so every sensitive elf avoids its listed friends through the first K rounds. | Medium7 | BacktrackingGraph+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Log Set (Small)Reconstruct the original integer multiset from the frequencies of all its subset sums, breaking ties by sorted order. | Medium7 | BacktrackingSorting+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Can't Stop (Large)Find the longest run of consecutive roll sets where every set contains at least one of k chosen numbers. | Medium7 | Sliding windowBacktracking | No attempts yet | 30s | 512 MB | Judgeable |
| Erdős and Szekeres Sequence ReconstructionRebuild the lexicographically smallest permutation of 1 to N whose increasing and decreasing subsequence lengths match the given arrays. | Medium7 | BacktrackingGreedy+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Opening the Treasure ChestsOpen all N chests in the lexicographically smallest order with single-use typed keys taken from other chests, or report IMPOSSIBLE. | Medium7 | GreedyGraph+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Yut Nori Board Check (Small)Decide whether the recorded throw sequence can produce the given board under the stated Yut Nori movement, capture, and shortcut rules. | Medium7 | BacktrackingSimulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| The Next NumberGiven N, the count of each nonzero digit in N defines the whole list; find the next number that has exactly those digit counts. | Medium7 | GreedyBacktracking+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Choosing a T-shirtThree players alternately cross out numbers from 1 to n, each trying to leave the survivor highest on his own ranking; find the survivor. | Medium7 | Game theoryBacktracking+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Finding a string with enough inversionsFind the lexicographically smallest permutation of the first N lowercase letters with at least V inversions that is not smaller than the given string S. | Medium7 | BacktrackingCombinatorics+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Mutalisk 2Given up to 20 SCVs with health, each attack deals 9, 3, and 1 damage to three distinct SCVs; find the minimum number of attacks to destroy all of them. | Medium7 | Dynamic programmingBit manipulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Rock Paper Scissors RankingGiven each contestant's probabilities for scissors, rock, and paper, find the probability that contestant 1 finishes in place K of the recursive elimination tournament. | Medium7 | ProbabilityDynamic programming+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Light UpPlace bulbs on white cells of an N by N Light Up board so every white cell is lit and each numbered black cell has the required count of adjacent bulbs, choosing the lexicographically smallest solution. | Medium7 | BacktrackingBrute force+2 | No attempts yet | 2s | 256 MB | Judgeable |
| MegaDamasGiven a checkers-like board with your and opponent pieces, find the maximum number of opponent pieces one capture move can take. | Medium7 | DFSBacktracking+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Tecle & SomeList every way to split S into terms of at most D digits whose concatenated digits form a path on a phone keypad using each digit at most once. | Medium7 | DFSBacktracking+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Crystal JailsGiven up to 27 small polycube blocks that may be rotated but not reflected, decide whether they tile a W x D x H box exactly. | Medium7 | BacktrackingRecursion | No attempts yet | 8s | 512 MB | Judgeable |
| Linear Ether GeometryConnect N libraries on a hallway to the internet using M cables and hubs, minimizing hubs first then total cable slack. | Medium7 | GreedyBacktracking+1 | No attempts yet | 8s | 512 MB | Judgeable |
| The divisor conquersPlace the N cards one at a time so each new card divides the sum of the cards already down, and print the lexicographically smallest winning order or No. | Medium7 | BacktrackingGreedy+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Tight-Fit SudokuFill a 6 by 6 grid with digits 1 to 9 so no digit repeats in a row, column, or 3 by 2 box, including split squares holding two digits. | Medium7 | BacktrackingImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Quality ExpressionsGiven a bracket expression with ? placeholders and per-arity limits, choose values so the expression is valid and its value is as large as possible. | Medium7 | Dynamic programmingTree+1 | No attempts yet | 1s | 64 MB | Judgeable |
| Safe road systemDelete the fewest road characters so every remaining road is connected to at least two neighbours under the given adjacency rules. | Medium7 | GraphBacktracking+1 | No attempts yet | 1s | 64 MB | Judgeable |
| Rather Perplexing Showdown (Large)Find the alphabetically earliest lineup of R, P and S players that lets a single-elimination tournament finish without any tie match. | Medium7 | BacktrackingDivide and conquer+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Technobabble (Small)Given N topics (N <= 16) made of two words, find the largest number of topics that could have been formed by combining an existing first word with an existing second word. | Medium7 | BacktrackingBrute force+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Placing TilesGiven a grid with blocked cells, cover every empty cell with 1 x k horizontal or vertical tiles (k is any positive integer, chosen per tile) and minimize the number of tiles. | Medium7 | BacktrackingDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Pythagorean TriplesGiven N stick lengths, pair them into as many disjoint pairs as possible so each pair forms the legs of a primitive Pythagorean triple. | Medium7 | GraphMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Mahjong Waiting TilesGiven a 13 tile mahjong hand numbered 1 to 9, list every tile still available that completes the hand into one head plus four bodies, or into seven distinct heads. | Medium7 | BacktrackingRecursion+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Going DutchGiven each person's net balance from the receipts, find the minimum number of money transfers that settles everyone to zero. | Medium7 | Dynamic programmingBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Twenty Four, AgainGiven four numbers in fixed order, find the minimum grade (parentheses plus adjacent-swap inversions) of an expression equal to 24 using each number once, with integer-only division. | Medium7 | Brute forceBacktracking+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Deck of CardsTwo players alternate playing a card matching the table card in color or value; the first unable to move loses, so find the winner under optimal play. | Medium7 | Game theoryGraph+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Single EliminationGiven the fixed win/loss outcome for every pair among 16 players, decide which players can be made champion by choosing all four rounds of pairings. | Medium7 | BacktrackingDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |
| CapsulesFill a grid so each outlined region holds 1..n exactly once and no equal digits touch even diagonally, printing the lexicographically smallest solution. | Medium7 | BacktrackingImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| World Cup DrawSimulate the World Cup draw by placing each team into the leftmost group that keeps the rest of the pot placeable, then sort groups by total rank. | Medium7 | GreedyBacktracking+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Frog placementAssign each of N frogs to a preferred pad so that every log, labeled with a topic, joins frogs whose interest levels agree on that topic, and print the lexicographically smallest assignment. | Medium7 | BacktrackingGraph+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Delivery GuyOn a tree of N restaurants with demand A_i, maximize total delivered peppers in M time units, where each visit costs 1 to deliver and each edge costs 1 to traverse. | Medium7 | TreeDynamic programming+2 | No attempts yet | 2s | 64 MB | Judgeable |
| Chicken DeliveryChoose at most M of the chicken restaurants to keep open so that the sum over all houses of the distance to the nearest open restaurant is minimized. | Medium7 | Brute forceBacktracking+2 | No attempts yet | 1s | 512 MB | Judgeable |
| A Very Nasty Graph ProblemBuild the lexicographically smallest de Bruijn sequence of order N over two symbols, a shortest binary string containing every N-bit number. | Medium7 | GraphDFS+2 | No attempts yet | 2s | 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 |
| Bob's RummikubGiven tiles in hand and a legal table arrangement, find the largest number of hand tiles Bob can add while keeping the whole table partitionable into groups and runs. | Medium7 | BacktrackingBrute force+2 | No attempts yet | 2.5s | 512 MB | Judgeable |
| Covering with Colored PaperOn a fixed 10x10 grid of 0s and 1s, cover every 1 with at most five squares of each size (1x1 through 5x5), non-overlapping and axis-aligned, using the fewest squares. | Medium7 | BacktrackingGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Laboratory 3Given a grid with walls and up to 10 viruses, choose M of them to activate simultaneously and minimize the time until the virus fills every empty cell, or print -1. | Medium7 | BFSBacktracking+2 | No attempts yet | 0.25s | 512 MB | Judgeable |
| Ant in a Hexagonal WebOn an infinite hexagonal web, count the ant walks that make exactly N turns before first revisiting a vertex, where the first step is fixed north. | Medium7 | DFSBacktracking+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Knapsack PackingGiven the multiset of all 2^n subset sums of n unknown non-negative weights, reconstruct the weights in non-decreasing order or report impossible. | Medium7 | SortingGreedy+2 | No attempts yet | 2s | 512 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 |
| TrapCount the self-avoiding walks of n unit grid steps that start at (0,0) going right and are trapped: no further step can be added without self-intersection. | Medium7 | BacktrackingDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |