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 results2,994 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Rope and QueriesMaintain a string under up to 100,000 queries that cut a substring and move it to the front or back, and print single characters. | Hard8 | Linked listImplementation+2 | No attempts yet | 0.3s | 512 MB | Judgeable |
| Intersecting RectanglesGiven n axis-aligned rectangles with all x and y coordinates distinct, decide whether any two boundaries cross or touch. One rectangle fully containing another does not count. | Hard8 | SortingSegment tree+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Ants on a CircleAnts move on a circle of N points, reversing on collision; for each query (P, X) find the earliest time point P has been visited at least X times. | Hard8 | MathSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| SEGWAYSimulate N riders over a 300 m track with three speed sections and accelerators granting 1 s/m boost for X mod 20 meters, where X counts riders strictly ahead, and print each finish time. | Hard8 | SimulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Random Number GeneratorSimulate a quadratic-polynomial generator to build a grid, then find the path from top-left to bottom-right whose sorted values are lexicographically smallest. | Hard8 | SimulationGreedy+2 | No attempts yet | 3s | 256 MB | Judgeable |
| Shopping MallSimulate customers choosing the counter with the minimum total wait (lowest index on ties), then compute a weighted sum of membership numbers in the order customers leave. | Hard8 | SimulationHeap+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Copy and Paste 2Simulate N copy-and-paste edits on a string capped at length M, tracking positions backward so the first K characters of the final string can be printed. | Hard8 | ImplementationBinary search+2 | No attempts yet | 1s | 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 |
| Just Passing ThroughGrid path from the west edge to the east edge moving east, northeast, or southeast, crossing exactly n passes, minimizing total elevation. | Hard8 | Dynamic programmingMatrix+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Pairing SocksGiven a sequence of 2n socks, find the minimum number of moves to pair all socks using two stacks with three allowed operations, or report impossible. | Hard8 | StackGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Max or MinGiven numbers on a circle and min/max operations over a value and its two neighbors, find for each x the least minutes to make all values equal x, or -1. | Hard8 | ImplementationGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Ice CreamGiven a capacitated pipe network with a chocolate source, a vanilla source, and a mixing sink, find the maximum flow that reaches the sink with equal chocolate and vanilla amounts. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Hold or Continue?For each query state (Catelyn score, Hoster score, current turn total) decide hold or continue to maximize Catelyn's win probability when both play optimally in Pig to exactly 75. | Hard8 | Dynamic programmingProbability+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 |
| Sink the Billiard BallA point ball bounces off the edges of an A by B table with velocity (p,q); count edge hits until it reaches a corner, or print -1 if it never stops. | Hard8 | MathNumber theory+2 | No attempts yet | 1s | 256 MB | Judgeable |
| MeetingsCows on a line swap velocities when they meet, stop at barns, and the question asks how many meetings occur before half the total weight has stopped. | Hard8 | SortingMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Loan RepaymentFind the largest X so that paying floor((N-G)/X) milk per day, floored at M, clears N gallons within K days. | Hard8 | Binary searchMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SealGiven a binary document grid and a binary seal stamp, decide whether the document is exactly the union of non-overlapping (and non-rotated) placements of the stamp. | Hard8 | ImplementationSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Block BreakerBlocks drop in a grid when a knocked block has a dropped left/right neighbor and a dropped front/back neighbor; after each of q moves, report how many blocks fall. | Hard8 | Union-findSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Exact ArithmeticSimulate a stack calculator whose values are sums of rationals and rational multiples of square roots, and print each result in a canonical exact form. | Hard8 | ImplementationMath+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 |
| PhysicsBalls move on a line with acceleration tied to speed, collide elastically, and each query asks for the k-th smallest velocity at time t. | Hard8 | MathSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Urban BlightGiven points and weighted segments, find a horizontal line whose intersection with the segments maximizes the total weight of segments it touches. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Right-hand obstructionCars arrive in four queues at a crossroad; a front car passes only if the queue on its right is empty, so simulate second by second and report each car's crossing time or -1. | Hard8 | SimulationQueue+2 | No attempts yet | 1s | 512 MB | Judgeable |
| BusSimulate bus boarding with passengers sitting in the closest free seat or standing over an occupied one, and choose Anton's seat minimizing the total time someone stands over him. | Hard8 | SimulationGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Folded Paper PaintingSimulate K rounds of folding a W by H rectangle along a vertical line and several horizontal folds, painting one rectangle each round through all layers, and report the unpainted area at the end. | Hard9 | GeometrySimulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Queen and Two KingsGiven a queen and two kings on a 100x100 board playing optimally, compute the minimum number of queen moves needed to capture either king. | Hard9 | Game theoryBFS+2 | No attempts yet | 2s | 128 MB | Judgeable |
| ShotGiven columns of black/gray/white cans stacked in fixed color order, repeatedly shoot a height to remove one layer from every tall-enough column and report the collapsing score after each shot. | Hard9 | Segment treeBinary search+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Pro Gamer YoungsikGiven time and resource budgets, compute the maximum number of top-tier units obtainable from a chain of unit upgrades where each unit can repeatedly spawn the next type. | Hard9 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Paper FoldingGiven a colored paper strip, determine the sequence of folds that minimizes final length while respecting a color-matching constraint on folded layers. | Hard9 | SimulationGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hanging HatsSimulate mages hanging triangular hats on a wall, tracking nail visibility and expulsion under coverage rules that require an advanced geometric data structure. | Hard9 | GeometrySegment tree+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Gates of LogicParse an ASCII-art diagram of logic gates and wires with grid tracing rules (junctions, crossings, negation, ports) and compute values propagated to every named output. | Hard9 | SimulationGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Grand Theft Auto WheelGiven star-shaped polar polygons for a bolt hole and several wrench lugs, determine which wrenches can be inserted but cannot fully rotate inside the bolt hole. | Hard9 | GeometrySimulation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Ground WorksSimulate water filling inside the region enclosed by a rotated Hilbert curve fractal against a tilted ground line, accounting for trapped air pockets, and output the flooded area to four decimals. | Hard9 | GeometrySimulation+2 | No attempts yet | 3s | 256 MB | Judgeable |
| K’ak’-u-pakal and the Maya ScriptParse a recursive grammar for Maya glyph compositions and render a minimal-size ASCII-art box layout respecting horizontal/vertical grouping and bracket-doubling size rules. | Hard9 | RecursionString+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 |
| TantrixSimulate the hexagonal tile game Tantrix and count all legal placements of hand tiles given complex forced-space and controlled-side rules. | Hard9 | SimulationGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Periodic PointsCount periodic points of period n for a piecewise linear map on [0,m] modulo a given value, detecting infinite solution cases. | Hard9 | MathGeometry+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Origami Through-HoleSimulate repeated paper folds with layered segments and reflection/overlap propagation rules, then count how many layers a pin punch pierces. | Hard9 | GeometrySimulation+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 |
| Brainf**k InterpreterDecide whether a given Brainfuck program halts on its input and, if it loops, report the matching bracket pair that encloses the infinite loop. | Hard9 | SimulationImplementation+2 | No attempts yet | 7s | 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 |
| Twirl AroundA bar inside a simple polygon rotates clockwise, pivoting on the wall whenever a new contact point appears; report the final position of one end, or the position when it jams. | Hard9 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ASCII ArtRender triangles with ASCII characters, projecting 3D vertices through a camera onto an S by S screen grid with depth-based visibility. | Hard9 | GeometryImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ArcheryPlace Seungwon into one of 2N gaps so that after R tournament rounds his final target number is minimized, breaking ties by the largest starting target. | Hard9 | MathSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Amazing RobotsTwo robots in separate mazes receive the same direction command each minute; guards patrol back and forth, and you must find the minimum time until both robots exit without capture. | Hard9 | BFSSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Tropical GardenCount starting ponds whose deterministic non-backtracking walk (prefer the most beautiful unused-at-previous-step walkway) reaches pond P after exactly K steps, for many K. | Hard9 | GraphSimulation+2 | No attempts yet | 5s | 256 MB | Judgeable |
| Watering the FieldsPlace 3-cell sprinklers on a fenced grid so every non-scarecrow cell is watered exactly once, choosing tracks and sprinklers by a fixed lexicographic rule. | Hard9 | GreedySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Forgetful WaiterCustomers sit around a round table and pass pizzas left or right each turn; find the minimum number of turns until every pizza reaches the customer who ordered it. | Hard9 | GraphGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Warez TestOn a grid of walls, boxes, and targets, find the shortest sequence of Jimmy's moves that pushes every box onto a target, breaking ties by the lexicographically smallest move string. | Hard9 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| City NavigationCompute the shortest legal right-hand-side driving distance between two driveways in a numbered grid city with some road segments missing. | Hard9 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PendulumSimulate an idealized pendulum swinging around point hooks on a wall and print the length of the periodic orbit it eventually settles into. | Hard9 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Construct the Wall MazeGiven three wall lengths and a shortest-path string in a 6x6 grid, construct a valid maze consistent with it, choosing the lexicographically smallest answer. | Hard9 | Brute forceBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Alea iacta estGiven a linear congruential generator, compute the maximum Yahtzee score over eleven rounds by choosing which dice to keep and which combination to score each round. | Hard9 | Dynamic programmingSimulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| DownpaymentGiven future monthly interest rates for m mortgage plans, binding periods, and switch penalties, find the schedule of plan choices that minimizes the total money paid, with debt rounded down each month. | Hard9 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Prince of PersiaGiven a grid room, mirrors with fixed orientations and allowed cells, and plates on walls, decide whether the light ray can reach every plate. | Hard9 | SimulationGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Deformed WheelSimulate a convex polygon rolling down a piecewise-linear hill until it comes to rest, and print the final position of its center of gravity. | Hard9 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parallel ExpectationsGiven two programs run by randomly interleaving their instructions, find the expected final value of every shared variable. | Hard9 | ProbabilityDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Find the BorderGiven a closed self-intersecting polyline, count the vertices of the border of its interior, the outer boundary enclosing all bounded regions. | Hard9 | GeometryImplementation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| SleepwalkerA self-similar walk on a 3^k by 3^k grid is defined by a recursive rewrite; given a starting tile on the walk and a hole tile, find the number of steps until the walk reaches the hole. | Hard9 | RecursionDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Recursive AntOn a 2^n by 2^n board with at most 50 forbidden cells, find for each of the four borders a cell where a recursive quarter-by-quarter Hamiltonian tour can end, or report none. | Hard9 | Divide and conquerRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FishesGroup recorded closed routes into the fewest fish, where two routes can follow on consecutive days if the start cells touch and every point is visible 24 hours earlier. | Hard9 | GraphGeometry+2 | No attempts yet | 2s | 512 MB | Judgeable |
| QuestionsSimulate a logic puzzle where princes and a sorcerer reason about a system of variable constraints over time; answer what each prince or the sorcerer knows. | Hard9 | Brute forceSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Video PokerFor a given video poker payout table, count how many of the 2,598,960 dealt hands make the optimal expected-value strategy discard exactly 0, 1, 2, 3, 4, and 5 cards. | Hard9 | Brute forceCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CrystalSum the signed charges of all three-colored unit triangles in a hexagonal crystal filled row by row from a modular generator. | Hard9 | MathGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Thirsty AntsAnts on a line walk at unit speed toward the nearest fallen dew drop, and the task asks for every ant's position when the last drop is drunk. | Hard9 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Aquarium DrainageGiven an orthogonal aquarium floor with holes on its segments, compute the total drain time and the water left behind. | Hard9 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CakeStarting from piece a, Leopold always eats the less delicious piece next to the empty interval, and each query asks how many pieces are eaten before piece b. | Hard9 | Segment treeDivide and conquer+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Asynchronous ExceptionsSimulate a multithreaded scheduler with yields, kills, fork modes, loops, and semaphores, then report each thread's finishing time and the final state. | Hard9 | SimulationHeap+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Rotating Cutter BitsThe program counts interior lattice points of a polygonal workpiece that survive one full rotation against a second rotating polygonal cutter. | Hard9 | GeometrySimulation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Ace in the HoleGiven Ben's examination order, restore the lexicographically greatest deck with no decreasing triple that makes his optimal search follow it. | Hard9 | Game theoryGreedy+2 | No attempts yet | 60s | 512 MB | Judgeable |
| Clock BreakingGiven several consecutive LCD clock displays, find segments that are always burnt out, burnt in, working, or unknown across all consistent start times and fault assignments. | Hard9 | ImplementationBrute force+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Counting points inside a circleFor each of M circle queries, count how many of N fixed points lie inside or on the circle, printing the count per query. | Hard9 | GeometryDivide and conquer+2 | No attempts yet | 8s | 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 |
| Mole TunnelsOn a binary-heap-shaped tree, each newly woken mole (in a fixed order) must be assigned to a hole with remaining food capacity, minimizing total walking distance; report the minimum for every prefix k. | Hard9 | TreeGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Map Reduce (Large)Each query asks whether walls can be removed so the shortest S-to-F path equals D, and if so reports the deterministic greedy removal order's final map. | Hard9 | BFSGraph+2 | No attempts yet | 5s | 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 |
| Shifty GridApply a fixed two-phase procedure of cyclic row and column shifts to sort a permutation grid into row-major order, following the exact TURN steps given. | Hard9 | SimulationImplementation+2 | No attempts yet | 2s | 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 |
| Jupiter Rock Paper ScissorsEach player crops a length-k substring, Alice morphs one block, then the play phase awards 2/1/1 points by who reaches m round wins first; report the optimal outcome. | Hard9 | Game theoryImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| In honor of Taekhee's graduationDeer bounce on a line segment [0,T], each with strength; a statue at x falls when the net force of deer that have reached it exceeds W. Maximize the fall time over x. | Hard9 | MathSimulation+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Circle SelectionProcess circles in decreasing radius order; each chosen circle removes all remaining circles that intersect it, and for every circle you must report which chosen circle eliminated it. | Hard9 | GeometrySorting+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| Growing MicroorganismsWith buy costs and production costs, buy microorganisms and make each kind produce others to reach x_i of every kind at minimum total cost. | Hard9 | MathGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| GameChoose the order in which balls are manually removed so chain reactions of merging equal neighbors delete as many other balls as possible; output that maximum count. | Hard9 | Dynamic programmingStack+2 | No attempts yet | 2s | 512 MB | Judgeable |
| MessengerDesign strategies for two players who alternately move a piece on a 4x4 grid, knowing neither the call order nor its timing, so B can deduce the secret value X within 10000 moves. | Hard9 | ImplementationSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| GnalcatsDecide whether two genes, each a sequence of seven possible base transformations on proteins, produce identical results or both fail on every sufficiently long input protein. | Hard9 | StringStack+2 | No attempts yet | 0.3s | 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 |
| CerealGiven a queue of cows each with a favorite and second-favorite cereal, report for every prefix removal how many cows still get a box. | Hard9 | GreedySimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| AdditionDesign a short string-rewriting script in a custom language that reads two binary numbers joined by + and rewrites them into their binary sum. | Hard9 | String matchingSimulation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Holy cow, Vim! (Easy)Construct a stack-language program that outputs x, but outputs 2x when its lines are reversed and -x when its lines are sorted lexicographically. | Hard9 | ImplementationSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| GeneratorRead an index 0 to 10 and output the exact contents of the matching recovered file gen_i.out from the archive. | Hard10 | ImplementationString+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Dungeon 2Explore an unknown connected graph through a move-and-color oracle and report, for each i, how many room pairs have shortest-path distance exactly i. | Hard10 | GraphBFS+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Shadow CompanionConstruct a fixed program over a bit tape with a shadow that transforms every input n < 2^10 into n squared. | Hard10 | SimulationBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Delightful (Easy)Write a program of at most 100 commands for a ternary computer with 26 40-trit registers that computes the length of the longest non-decreasing prefix of the input in register X and leaves the answer in Y. | Hard10 | ImplementationSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |