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 results6,398 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Beware the GeoducksGiven two fixed walking routes on a weighted graph, decide whether the two travelers ever occupy the same point within t seconds, accounting for nodes with geoducks that make a traveler vanish. | Hard8 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Weighty ProblemChoose which coins to hand over for a purchase so that the total weight of unspent coins plus the store's greedy change is minimized. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| JengaismSimulate Jenga moves (remove a block, place it on top) and report when any structure topples because its center of gravity leaves the convex hull of its supports. | Hard8 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Concentration CardsGiven N cards of size W by H that can each be rotated, tile a filled rectangle with them and find the smallest possible perimeter. | Hard8 | MathGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CubeGiven an n by n by n grid of letters, decide whether the connected same-letter pieces can be pulled apart without cutting, meaning no single piece separates the cube. | Hard8 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PartitionsGiven k and a, output the a-th partition of k in lexicographic order, or Too big when a exceeds the partition count. | Hard8 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ransom NoteGiven a target note and a newspaper text, find the minimum number of contiguous clips (letters and spaces only, case-insensitive, reusable) needed to paste the note. | Hard8 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SnailsEach of N snails moves in a fixed direction at speed 1 and stops at the fence, at any point an earlier snail crossed, or when it meets another snail simultaneously; find when the last snail stops. | Hard8 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Railway ConnectionFind the cheapest route from station s to g in a multigraph where each maximal run of same-company edges is priced by that company's piecewise linear, concave fare table. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Generic PokerCount hands of L cards (ranks 1 to M, N copies each) that match a pattern of wildcards and variables shifted by pluses, then print the probability as an irreducible fraction. | Hard8 | CombinatoricsBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow Ski AreaBuild the directed graph where each square has edges to same-or-lower neighbors, then find the minimum number of bidirectional edges to add so the whole graph becomes strongly connected. | Hard8 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CloudsEach cloud is a polygon moving with the same velocity; count the separate time intervals during which the vertical beam at the origin intersects at least one cloud. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Similar PolygonsDecide whether two polygons are similar, and if so print the square of the similarity factor as a reduced fraction and the matching vertex index in the second polygon. | Hard8 | GeometryString matching+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Similar PolygonsDecide whether two polygons are similar under rotation, reflection, translation, and scaling, then output the exact squared similarity ratio and the smallest matching vertex index. | Hard8 | GeometryString matching+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Making test data 3Construct the lexicographically smallest SSSP test file (at most T integers) on which optimized Bellman-Ford finishes under C iterations but Floyd-Warshall exceeds C, or report that none exists. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Conditional StatementsParse a small nested if language, then for each checkpoint decide which variable assignments can reach it and print the forced true/false variables or unreachable. | Hard8 | SimulationImplementation+2 | No attempts yet | 10s | 128 MB | Judgeable |
| Obstacle CourseFind the minimum number of seconds to steer a sliding puck to a target on an ice rink, accelerating per second while avoiding integer-coordinate obstacles. | Hard8 | BFSSimulation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Obstacle CourseTap a sliding puck to change its velocity and reach a target point in the fewest seconds without touching any axis-aligned obstacle stick. | Hard8 | BFSSimulation+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Number SquareFill an N x N Latin square with 1..N given some pre-filled cells and inequalities between neighboring cells, choosing the lexicographically smallest valid board. | Hard8 | BacktrackingImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Changing Phone NumbersGiven area codes and a sequence of rules (digit duplication, digit swap, area-code change) applied over time, answer queries transforming a phone number from one year to another. | Hard8 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Map LabelerGiven city points in the plane, find the largest square label size so that each label has its city at the midpoint of its top or bottom edge and no two label interiors overlap. | Hard8 | Binary searchGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| JaWsGiven two rows of equilateral triangles, drop the upper row onto the lower one and report where it settles or which side it slides off. | Hard8 | GeometrySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Bermuda TriangleGiven a regular hexagon of side s and allowed equilateral triangle sizes, decide whether the hexagon can be tiled exactly by triangles of those sizes. | Hard8 | BacktrackingGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| University Entrance ExaminationGiven students with scores, home regions, and program preference lists, plus program capacities, assign students to programs under a local-region priority rule and a fairness rule. | Hard8 | ImplementationGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Museum Heist: Area of the Shadowy RegionsGiven an axis-aligned rectangle with non-overlapping rectilinear polygonal obstacles and a gun at the upper-right corner, find the total area of points no monotone beam can reach. | Hard8 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Magazine DeliveryThree cars start at L1 and must deliver to locations in strict order 2,3,...,N, with only one car moving at a time; minimize the total completion time. | Hard8 | Dynamic programmingShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FarmlandGiven a planar graph of farming regions, count the proper regions bounded by a simple cycle with no interior vertices or edges and exactly k boundary edges. | Hard8 | GraphGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RobotsSimulate a 31x31 robot game where robots chase you, applying a tie-broken greedy movement and teleport strategy to report whether you win or lose. | Hard8 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word EncodingGiven up to 1000 forbidden substrings of length 1 to 3, rank valid words by length then alphabetically; answer queries converting a word to its index and an index to its word. | Hard8 | Dynamic programmingString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pseudo-random NumbersGiven the first L digits of a pseudo-random sequence generated by repeatedly summing adjacent base-B digits, decide whether the T-th element is forced, or report impossible or unpredictable. | Hard8 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Inlay CuttersCount all 45-degree right isosceles triangles formed by grid-aligned cuts and diagonals on an M by N plate after K straight cuts. | Hard8 | GeometryImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Statistical TroubleOutput each cross table of two survey questions as raw counts and rounded row and column percentages in a fixed 6-character grid. | Hard8 | ImplementationMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| LibraryGiven shelf and peg geometry in a niche, find a redesign that seats a fixed tome on one shelf while minimizing pegs moved and plank cut. | Hard8 | GeometryBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FenceCompute the total illumination reaching the lit parts of a polygonal fence from a point lamp, accounting for shadows and the cosine obliquity factor. | Hard8 | GeometryImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Black BoxFind all 6x6 atom placements inside an 8x8 box that reproduce a set of laser entry and exit experiments, and report the layout if it is unique. | Hard8 | SimulationBrute force+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Consecutive OnesPermute the columns of a 0-1 matrix so that the 1s in every row are consecutive, with column 0 fixed as the first column. | Hard8 | GraphImplementation+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| EllipseGiven five integer points, either report that no unique ellipse passes through them or compute that ellipse's area to six decimals. | Hard8 | GeometryMath+2 | No attempts yet | 2s | 64 MB | Judgeable |
| Incredible! Impossible!Count n by 3 tables of non-negative integers with given row sums and column sums, modulo 10 to the 17. | Hard8 | Dynamic programmingCombinatorics+2 | No attempts yet | 2s | 64 MB | Judgeable |
| HighwaysGiven N cities on a line with one-way roads only left to right, add two non-touching one-way roads to make the network strongly connected at minimum total length, or print 0. | Hard8 | GreedyImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Key InsertionSimulate the recursive Insert operation on an infinite array for N keys and print the final occupancy up to the largest filled cell. | Hard8 | Union-findImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| PlatformsGiven points with distinct x, find the longest chain of flights where each next point has larger x and no larger y, then report every point lying on some longest chain. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Robotic InvasionEdit as few commands as possible in a movement string so the robot reaches a trap, breaking ties by earliest capture and then lexicographic order. | Hard8 | BFSDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ExpressionsFor each range of digits and target, print every fully bracketed expression over the digits in order that evaluates to the target. (Note: summary must be one sentence, at most 160 chars.) | Hard8 | BacktrackingRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Lattice Points in the Union of CirclesCount integer lattice points inside the union of up to 10,000 circles, restricted to the coordinate box from -16383 to 16384. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The RaceCount all overtakes among spaceships with given starting positions and speeds, then list the first 10000 in time order. | Hard8 | SortingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Space BoomerangGiven M direction vectors in N-dimensional space, find every vector that cannot appear with a nonzero coefficient in any linear combination summing to zero. | Hard8 | MathGeometry+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Identity CheckerEach test case gives a reverse Polish expression in x with sin, cos, and tan; decide whether it equals zero wherever defined. | Hard8 | MathString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Burns' RodsGiven the six colors on each of N slices plus both end caps, decide whether some sequence of 180-degree twists makes labels share a color exactly when they share a face. | Hard8 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The 2 x 2 x 2 Rubik's CubeGiven a scrambled 2x2x2 Rubik's cube, compute the minimum number of 90-degree turns needed to solve it. | Hard8 | BFSSimulation+2 | No attempts yet | 10s | 1024 MB | Judgeable |
| 2D MatrixSplit N points into two disjoint non-empty sets, each centrally symmetric, and print every division's two centres in lexicographic order. | Hard8 | Hash mapSorting+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Collision of AsteroidsGiven two moving convex hulls in 3D, decide whether they overlap at some past or future time. | Hard8 | GeometryBinary search+1 | No attempts yet | 1s | 16 MB | Judgeable |
| Union Area of TrianglesGiven right isosceles triangles with axis-parallel legs and hypotenuse of slope -1, compute the area of their union. | Hard8 | GeometrySegment tree+2 | No attempts yet | 1s | 32 MB | Judgeable |
| CakesSchedule dough preparation and single-oven baking for N cakes so that all finish as early as possible. | Hard8 | GreedySorting+1 | No attempts yet | 1s | 32 MB | Judgeable |
| BattleshipFire order over a 10x10 grid is given; place the ten standard ships without touching so the game lasts as long as possible. | Hard8 | GreedyBacktracking+2 | No attempts yet | 2s | 256 MB | Judgeable |
| GridGiven n points, decide whether there exist an axis-aligned grid of evenly spaced lines and a straight line whose intersection set is exactly those points. | Hard8 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Log AnalysisMaintain a volatile log under insertions in the middle, block deletions, and queries asking how many distinct event types appear in a position range. | Hard8 | ArraySegment tree+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Red Chips, Green ChipsWith r red and g green chips, players alternately remove k chips of one color where k divides the other color's count; decide the winner under optimal play. | Hard8 | Game theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Almost ClearGiven two disjoint convex polygons A and B and a point C outside both, decide whether B hides none, part, or all of A as seen from C. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| WalawehEach Walaweh list W_L is built from W_{L-1} by a fixed 8-step cycle of append/prepend and optional reversal operations; convert between (length, index) and the binary string. The recursion only needs O(log N) work per level, but the reversal and leading-zero handling make the index bit-mapping non-obvious. | Hard8 | RecursionBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Worst LocationsGiven a perfect binary tree and two distance-from-leaf descriptions, decide whether some pair of matching vertices sits farther than Z apart. | Hard8 | TreeGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Playing With StonesA subtraction game on piles where each move removes at most half a pile; decide if the first player wins, with pile sizes up to 2e18. | Hard8 | Game theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Road AccidentFind which quarter-part of each car (corner plus adjacent side halves) first touches the other car during straight-line motion before impact. | Hard8 | GeometrySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Harder Sokoban ProblemChoose player and container start cells to maximize the minimum Sokoban moves needed to push the container onto the single destination cell. | Hard8 | BFSGraph+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Fool GameGiven a trump suit and both hands, find the lowest-ranked opening card that forces the defender to take, assuming optimal defense. | Hard8 | Game theoryDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Museum TourGiven a connected graph with max degree 3 and a fixed cyclic door order per room, count starting rooms whose edge-following walk eventually traverses every corridor. | Hard8 | GraphSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Arithmetic RectangleGiven an n by m grid of integers, find the largest rectangle in which every row and every column forms an arithmetic sequence, and output its area in unit squares. | Hard8 | Dynamic programmingArray+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Bits GeneratorCount how many of the m possible seeds make a floor-mod pseudorandom generator output a given bit string of length n. | Hard8 | MathNumber theory+2 | No attempts yet | 3s | 64 MB | Judgeable |
| Intelligence QuotientGiven a bipartite acquaintance graph and IQ values, choose a clique (subsets of both sides where every cross pair is acquainted) maximizing total IQ. | Hard8 | GraphCombinatorics+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Ternary TreesLabel the leaves of a complete ternary tree so that, given a fixed query order, the leaf values stay hidden until every leaf is asked. | Hard8 | TreeRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hallucinogenic CarnationsFor each of up to 10000 polygons, sum the carnations in grid parcels whose area at least half lies inside the polygon. | Hard8 | GeometryPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TetrisCount ways to fully tile a 4-by-n board with seven Tetris pieces (long piece has 3 cells), given some cells of the first row already covered, modulo 10^6. | Hard8 | Dynamic programmingMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fibonacci SumsGiven two Zeckendorf representations of positive integers, compute the Zeckendorf representation of their sum. | Hard8 | GreedyMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Special Forces ManoeuvresDiscs cover the plane; find the smallest prefix of the given order whose union already covers the entire plane, or report NIE if no prefix does. | Hard8 | GeometryBinary search+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Evaluation of an ExpressionCount assignments of values to variables modulo a prime that make a given sparse polynomial expression zero, output modulo 30011. | Hard8 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Catching MolesChoose at most k holes to shoot on a circle; each shot removes the target's moles and pushes neighbors' moles outward, maximizing the total removed. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| GatesEach gate outputs the majority state of its inputs (0, 1/2, or 1); decide for every gate whether its state is the same across all valid circuit states. | Hard8 | ImplementationGreedy+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Maximal Orders of PermutationsFor each n, find the smallest partition of n whose parts have the maximum possible LCM, then output the lexicographically smallest permutation with those cycle lengths. | Hard8 | Number theoryGreedy+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Numerals of the PrzesmyksConvert numerals over {- , +} with at most m1 consecutive minuses into their rank-ordered representation under the bound m2. | Hard8 | CombinatoricsMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SkiersGiven a planar DAG whose edges leave clearings in west-to-east order, find the minimum number of downhill paths that cover every edge. | Hard8 | GraphDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PawnGiven horizontal and vertical step sizes, count lattice cells reachable from (1,1) inside an axis-aligned rectangle. | Hard8 | Number theoryMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Green GameOn a bipartite board where Ann and Billy alternately move a pawn, find all starting fields from which Ann can force the first repeated field's cycle to contain a green field. | Hard8 | Game theoryGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Peaceful CommissionPick exactly one deputy from each of n pairs, avoiding forbidden deputy pairs, and print the lexicographically smallest valid choice or NIE. | Hard8 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IslandGiven all pairwise shortest tolls among the n seaside triangles, recover the adjacency structure and edge weights of the underlying border tree. | Hard8 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| NecklacesDecide whether two run-length compressed string descriptions encode the same circular necklace up to rotation. | Hard8 | StringString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| City TourGiven a connected 4-regular multigraph with an object on each edge, decide whether some closed Eulerian tour starting at an edge midpoint never lets accumulated interest drop below zero. | Hard8 | GraphGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triple-Arm CraneGiven p, q, n, find the lexicographically smallest sequence of triple placements (x, x+p or x+q, x+p+q) that covers wagons 1..n exactly once. | Hard8 | GreedyMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| P-Broken-LineFind the minimum number of axis-parallel unit-free segments in an orthogonal polyline from A to B that avoids all n given axis-parallel obstacles. | Hard8 | BFSGraph+2 | No attempts yet | 3s | 512 MB | Judgeable |
| AltarsFor each rectangle temple, decide whether a ray from its center can exit through the half-wall entrance and escape to infinity without touching any rectangle. | Hard8 | GeometryImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PolygonGiven a convex polygon and its triangulation, find the maximum number of triangulation triangles a single elementary triangle can intersect. | Hard8 | GeometryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| WindowGiven an orthogonal polygon and an axis-parallel window, count how many separate interior fragments of the polygon are visible through the window. | Hard8 | GeometryImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Ali BabaGiven starting tokens and trade rules over three token types, find the minimum number of trades to reach at least the required counts per type, or NIE if impossible. | Hard8 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RooksPlace n non-attacking rooks, one per given axis-aligned rectangle, or report that no placement exists; output the lexicographically smallest placement. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Disk OptimizationGiven disk sectors holding files split across blocks, find the minimum copy/swap cost to pack files into consecutive sorted blocks. | Hard8 | SortingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The PostmanDecide whether a directed graph has an Euler circuit from node 1 that contains each given sequence as a contiguous run of the route. | Hard8 | GraphDFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Quaternary BalanceGiven n up to 1000 digits, count modulo 10^9 the distinct minimum-mass weighings of n grams with masses that are powers of four, placed on either pan or both. | Hard8 | Dynamic programmingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Plot purchaseGiven an n by n grid of non-negative prices, decide whether some axis-aligned subrectangle has a sum between k and 2k inclusive. | Hard8 | Prefix sumGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Words 2Given exponents k1..kn, find the smallest m such that the concatenation of h_k(0) is a substring of h_m(0), or report NIE. | Hard8 | StringRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| King SejongGiven a graph where no path from 1 to 2 uses fewer than 4 edges, find the maximum number of edges that can be added while keeping the 1-to-2 distance at least 5. | Hard8 | GraphGreedy+2 | No attempts yet | 3s | 512 MB | Judgeable |
| LampGiven rectangular windows on two parallel walls 10 m apart and a lamp on one wall, count the windows of the lamp's building whose interior any reflected ray can reach. | Hard8 | GeometryImplementation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| FrogFor each rock, find where a frog lands after exactly m leaps, where each leap goes to the k-th nearest rock with ties broken toward the spring. | Hard8 | Two pointersBinary search+1 | No attempts yet | 3s | 512 MB | Judgeable |