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 |
|---|---|---|---|---|---|---|
| Sensor NetworkFind the largest group of sensors where every pair lies within distance d and print its size and members. | Hard8 | BacktrackingGraph+1 | No attempts yet | 2s | 128 MB | Judgeable |
| SnakeReconstruct the Hamiltonian path numbering of a 3 by n board from some given cell numbers. | Hard8 | BacktrackingGraph+1 | No attempts yet | 3s | 512 MB | Judgeable |
| Self-Describing SequencesCount length-N sequences where each entry A[i] equals the number of times i appears in the sequence. | Hard8 | MathCombinatorics+1 | No attempts yet | 1s | 256 MB | Judgeable |
| A Die MakerRoll a die on a board so each move increments the face that lands down, and print the dictionary-smallest move string that reaches the six target numbers. | Hard8 | BFSGreedy+2 | No attempts yet | 8s | 256 MB | Judgeable |
| One Clean Slice!Split an R by C by H block with guillotine cuts into N boxes with one raisin each to maximize the smallest box volume. | Hard8 | BacktrackingBinary search+1 | No attempts yet | 1s | 16 MB | Judgeable |
| Selling NumbersCount how many D-digit strings, with leading zeros allowed, have exactly the memorability score S defined by palindromic and repeated substrings. | Hard8 | BacktrackingCombinatorics+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Tree of PainDecide for each small pattern tree whether it embeds into the organization tree with matching labels and ancestry preserved both ways. | Hard8 | TreeDynamic programming+2 | No attempts yet | 1s | 256 MB | Judgeable |
| MosaicFill empty grid cells with black right triangles so white regions form rectangles and numbered squares meet their counts, then report the triangle total. | Hard8 | BacktrackingBrute force | No attempts yet | 1s | 256 MB | Judgeable |
| Tour de FranceFind the shortest directed tour that visits each of up to 36 cities exactly once when every city has at most two outgoing and two incoming roads. | Hard8 | BacktrackingGraph | No attempts yet | 2s | 256 MB | Judgeable |
| Hole in OneFind the most walls a ball shot from the origin can destroy by bouncing off axis-aligned walls before dropping into the hole. | Hard8 | BacktrackingGeometry+1 | No attempts yet | 5s | 256 MB | Judgeable |
| ICPC TeamsCount ways to split 3N students into teams of three so all M same-team and different-team pairs hold, modulo 1e9+9. | Hard8 | CombinatoricsUnion-find+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Watering the fieldsCover every non-scarecrow cell with trominoes of three cells while letting at most R times C trominoes cross field borders. | Hard8 | ImplementationBacktracking+1 | No attempts yet | 1s | 128 MB | Judgeable |
| HypercubeDecide whether a tree-like polycube of eight cubes folds along shared faces into the surface of a four-dimensional hypercube. | Hard8 | BacktrackingGeometry | No attempts yet | 1s | 256 MB | Judgeable |
| King's InspectionFind the lexicographically smallest directed tour that starts and ends at city 1 and visits every other city exactly once. | Hard8 | GraphBacktracking+1 | No attempts yet | 10s | 512 MB | Judgeable |
| Routing a Marathon RaceFind a simple path from junction 1 to junction n that minimizes the total personnel cost of the junctions on the path and their direct neighbors. | Hard8 | BacktrackingGraph+2 | No attempts yet | 3s | 256 MB | Judgeable |
| Connect the CellsConnect each color pair with disjoint grid paths that cover every cell and print the lexicographically smallest direction map. | Hard8 | BacktrackingGraph+1 | No attempts yet | 3s | 256 MB | Judgeable |
| High JumpReconstruct each height's clears and misses from the recorded attempt order and report the top three jumpers under the countback tiebreak. | Hard8 | SimulationBacktracking | No attempts yet | 1s | 256 MB | Judgeable |
| Alphabet Blocks and PasswordsArrange A to Z into the lexicographically smallest permutation with none of the given passwords appearing as a contiguous block. | Hard8 | BacktrackingString matching+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Drum Decorator (Small)Count cylindrical grid fillings where each cell holding K has exactly K equal neighbours, up to rotation, modulo 1e9+7. | Hard8 | CombinatoricsDynamic programming+1 | No attempts yet | 5s | 512 MB | Judgeable |
| The peak that looks highestGiven each peak's apparent-highest peak ahead, assign integer heights matching all sightings and print the lexicographically smallest heights or Impossible. | Hard8 | GeometryBacktracking+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Yut Nori (Large)You receive every throw in order and the pieces left on the board, and you decide whether the game rules can produce that board. | Hard8 | BacktrackingSimulation+1 | No attempts yet | 10s | 512 MB | Judgeable |
| Mystery Square (Large)Fill each ? in the binary string with 0 or 1 so the result is the binary form of a perfect square. | Hard8 | Number theoryBacktracking+1 | No attempts yet | 60s | 512 MB | Judgeable |
| Ninjutsu (Small)Cut the rope to any length up to R so the counterclockwise swing bends around the maximum number of point targets. | Hard8 | GeometryBacktracking | No attempts yet | 5s | 512 MB | Judgeable |
| Number of Simple CyclesGiven two trees on N vertices with N up to 9, choose a bijection linking them to maximize the number of simple cycles of length K. | Hard8 | BacktrackingGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Red segments and blue segmentsColor N points red or blue, then draw non-crossing same-color segments so that no red and blue segment touch; maximize total segment scores. | Hard8 | Dynamic programmingGeometry+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Color the Map ExtremeGiven simple polygons for each country, decide adjacency when borders share a positive-length segment, then find the chromatic number of the adjacency graph. | Hard8 | GeometryGraph+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Segments in a Regular PolygonCount the orders in which the remaining polygon vertices can be visited so each new segment crosses an existing one and the path closes back to P0. | Hard8 | BacktrackingDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Palindrome cipher decryptionFor each string, find its longest palindromic subsequence and output the lexicographically smallest one among those of maximal length. | Hard8 | Dynamic programmingString+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Restriction Enzyme MapReconstruct which positions on a circular DNA of length up to 20 are cut by enzyme A or B, given the distinct fragment lengths from cutting with A, with B, and with both, minimizing site count then lexicographic order. | Hard8 | Brute forceBacktracking+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Invisible IntegersGiven up to 10 hints, each a walk order of distinct digits 1 to 9, find the shortest hidden integer sequence that can produce every hint. | Hard8 | BacktrackingDFS+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Game on GraphOn a directed graph, Gennady prefers an endless game over winning and Georgiy prefers winning over everything but an endless game; report the outcome (W, L, D) for every start vertex and both first players. | Hard8 | GraphGame theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| The Gardener of Seville (Small)Fill an R by C grid with / and \ hedges so that each given pair of border courtiers is connected by a wall-free path, choosing the lexicographically smallest grid. | Hard8 | BacktrackingBrute force+2 | No attempts yet | 5s | 512 MB | Judgeable |
| CommunismAssign each of N jobs to one of three people so that Ad's total and Larry's total differ by at most D, and count the assignments. | Hard8 | MathBacktracking+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Operation (Small)Given a start value S and up to 15 operation cards, order all cards to maximize the final rational result, printed as an irreducible fraction with positive denominator. | Hard8 | Brute forceBacktracking+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Keep it coveredDecide whether a grid of dots and empty cells can be tiled by four line-piece types so that lines match across shared sides and never touch the border. | Hard8 | GraphDFS+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| SumdokuFill a 9x9 Sudoku grid so that constrained adjacent cells inside each 3x3 block satisfy <, =, or > versus 10, and print the lexicographically smallest solution. | Hard8 | BacktrackingImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Making a Beautiful PuzzleFill each square of an N by M board with one of four colors so that orthogonal neighbors differ, maximizing total beauty and counting optimal placements modulo 1e9+7. | Hard8 | Dynamic programmingBacktracking+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Frogs 2Assign one frog to each pad so that every frog sits on a preferred pad and each log joins two frogs with equal interest in the log's topic. | Hard8 | GraphBacktracking+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Ladder ManipulationGiven a ladder with N vertical lines, H rows, and M existing rungs, find the minimum number of rungs to add so every walk from column i ends at column i, or report -1 if more than 3. | Hard8 | BacktrackingBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| PathsCount simple paths in a vertex-colored graph where every vertex on the path has a distinct color, counting both directions separately. | Hard8 | GraphDFS+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| Turf WarsEach gang owns disjoint axis-aligned rectangles; pick exactly one rectangle to drop per gang so that no two kept rectangles from different gangs overlap, and report whether this is possible. | Hard8 | GeometryBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Playoff by all the teamsCount the ways to fill in the unplayed matches of a round-robin tournament so that every team ends with the same number of wins. | Hard8 | Brute forceBacktracking+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Word ClockPlace n distinct words left to right on an h by w grid where words may share letters, or report that no placement exists. | Hard8 | BacktrackingImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Club Room ExpansionGiven each cell's count of walled directions (0 to 4), decide whether the grid can be fully partitioned into connected rooms of one to three cells fitting that wall count. | Hard8 | Dynamic programmingBacktracking+2 | No attempts yet | 1s | 512 MB | Judgeable |
| InversionGiven the inversion graph of a permutation on at most 100 vertices, count its independent sets that also dominate every vertex outside. The answer fits in 10^18. | Hard8 | GraphBrute force+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Interesting World of ArraysCount arrays of length n whose values each satisfy a[i] = count(i) mod m, for n up to 12 and m up to 1e9. | Hard8 | CombinatoricsMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| MaaaaaaaaazeGiven five 5x5 boards, rotate each freely, stack them in any order, then find the shortest path through the resulting 5x5x5 cube from one corner to the opposite corner. | Hard8 | Brute forceBFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Dice YutnoriGiven 10 die rolls, move one of four pieces around a branching Yutnori board each turn and maximize the score collected from numbered squares. | Hard8 | BacktrackingSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Game of Falling BlocksSimulate a simplified Tetris game that uses bag randomization of the seven tetrominoes, and decide for each piece where to place it to complete at least one row before the game is lost. | Hard8 | SimulationGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| OnesFor each k up to 1e9, output a 1-expression using only ones, +, *, and parentheses that evaluates to k with at most 100 ones, or NO. | Hard8 | Dynamic programmingMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Teenage SharkSimulate a 4x4 board where numbered fish rotate and swap, and a shark moves along its direction eating fish; find the maximum total value eaten. | Hard8 | SimulationBacktracking+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Counting Multiples by Divisor CountGiven N up to 10^18, count positive integers X that are multiples of N and have exactly N divisors, or report infinitely many. | Hard9 | Number theoryCombinatorics+2 | No attempts yet | 1s | 512 MB | Judgeable |
| L GameGiven a 4x4 L-Game board, determine if the player to move has a forced win, output the lexicographically smallest winning resulting board, or report draw/loss under perfect play. | Hard9 | Game theoryBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fool's GameSimulate the full two-player card game 'Fool' with optimal play from both sides and determine which player ultimately wins. | Hard9 | Game theoryDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Moon of ValenciaGiven a map of places with satisfaction values and walking edges, decide for each query whether a simple path between two nodes exists that fits a time budget and yields a satisfaction sum within 0.1 of a target. | Hard9 | BacktrackingDFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hobby on RailsGiven a grid of rotatable rail units including switches, find the maximum-length cyclic route through a switch over all valid layouts where every switch end connects to another switch. | Hard9 | BacktrackingSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangle CutsGiven a large triangle and four small triangles as angle triples in clockwise order, decide whether three straight cuts can produce exactly those four pieces. | Hard9 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Old MemoriesGiven pieces of an original text and an altered copy with at most d edits, list all original strings whose edit distance to the copy is at most d and where every position lies inside some piece occurrence. | Hard9 | String matchingDynamic programming+2 | No attempts yet | 10s | 128 MB | Judgeable |
| Congruent Partition of ChocolateGiven a connected polyomino of at most 36 unit squares, decide whether it splits into two connected pieces that are congruent under rotation, reflection, and translation. | Hard9 | Brute forceDFS+2 | No attempts yet | 30s | 128 MB | Judgeable |
| Tied DownGiven a closed polygonal rope loop and up to 10 collinear posts on its left, find the smallest set of posts to remove so the rope can be pulled free to the right. | Hard9 | GeometryGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Growing Orthogonal SpiralDecide whether an orthogonal spiral whose segment lengths grow by at least 1 can end exactly at (x, y) and print the shortest such lengths. | Hard9 | MathNumber theory+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Bulb PuzzleYou rotate every elbow and straight wire so all wires form one path that joins the two bulbs, and print the smallest such layout. | Hard9 | GraphBacktracking+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Calvinball Championship, Again 2Split n players into the fewest teams so no pair who dislike each other shares a team. | Hard9 | GraphBacktracking+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Paths of Yin and Yang (Small)Count the black-and-white colorings of an N by M grid in which each color class forms a single path with two ends. | Hard9 | CombinatoricsBacktracking+1 | No attempts yet | 30s | 512 MB | Judgeable |
| King GameOn a small board with burned squares, two players alternately move a king to an unvisited neighboring square; report who wins under optimal play. | Hard9 | Game theoryGraph+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Binary cryptarithm decryptionGiven a short cipher string where letters replace some characters of an unknown binary equation, count how many valid equations from the given grammar match it. | Hard9 | BacktrackingDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Game MovesGiven a reachable 2048 board and its score, find the minimum number of moves that could have produced that state, using the merge rules and random tile births. | Hard9 | Dynamic programmingBacktracking+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Magical Mystery Knight's TourFill the missing numbers so the 8x8 board becomes a semi-magical knight's tour with equal row and column sums, choosing the lexicographically smallest completion. | Hard9 | BacktrackingBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| The Gardener of Seville (Large)Fill an R by C grid with slash or backslash hedges so that paired border courtiers connect through disjoint corridors, choosing the lexicographically smallest valid maze or reporting IMPOSSIBLE. | Hard9 | ImplementationSimulation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Stack Management (Small)Decide whether a solitaire game on 2 to 4 short stacks of cards can be reduced to at most one card per stack using two allowed moves. | Hard9 | Game theorySimulation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| General graph matchingGiven an undirected graph with N vertices and M edges, print the size of a maximum matching. | Hard9 | GraphGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cryptarithm?!Given three letter strings A+B=C, decide whether some assignment of distinct digits to letters makes the addition valid, columns up to 18 long. | Hard9 | BacktrackingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RulerFind the shortest ruler with N marks (0 to L) where all pairwise distances between marks are distinct, and print the mark positions. | Hard9 | BacktrackingBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Nonogram QRSolve a chain of 2000 nonograms to reconstruct QR codes, decode them, follow indicator links, and recover a flag. | Hard9 | BacktrackingSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| LogoGiven up to five polyomino patch shapes (each a subset of a 3x3 grid, flippable and rotatable) and up to three grid designs up to 55x5, decide if each design can be tiled exactly by non-overlapping patches and find the minimum patch count, or report NIE. | Hard10 | Dynamic programmingBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |