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 |
|---|---|---|---|---|---|---|
| Gooseberry Tart BASICImplement a fast interpreter for a small BASIC subset with LET, GOTO, IF, FOR/NEXT, OUT, and COMMENT, printing each program's output. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Standing PinsGiven fallen wires specified by endpoints, reconstruct the unique grid of pin heights, or report no solution when zero or multiple height assignments exist. | Medium7 | GraphBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The God DelusionOn a tiny grid each atom holds one numbered electron except a blank; slide electrons into empty neighbours to send each to its own atom in the fewest moves. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Functional Programming CountsImplement an interpreter for a tiny functional language with variables, single-parameter functions, and call-count profiling per definition line. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Martian PitsOn a grid with pits, command a rover that moves at speed 0 to 5 to reach the destination stopped in the fewest seconds. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Emergency RoomSimulate patients taking the lowest free seat on arrival, track who sits within 2 metres for 20 consecutive minutes, and count infections spreading one day later. | Medium7 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Health Plan ComparisonParse free-text health plan descriptions to extract premiums and copay rules, then compute each plan's total yearly cost across the given visits. | Medium7 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hermit CrabsSimulate hermit crabs that outgrow shells over time and fight for larger unoccupied shells, then list survivors at time T. | Medium7 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Walking the PlankSimulate pirates crossing a one-at-a-time plank to ferry N items, honoring side-priority, FIFO queues, and ties broken by slowest pirate. | Medium7 | SimulationQueue+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SnookerGiven the sequence of potted ball values in a valid snooker game with hidden scores, find the earliest shot after which the trailing player can no longer win. | Medium7 | SimulationGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RoadGiven a road with passing places and a matrix describing where each eastbound car passes each westbound car, compute the minimum total time to realize that schedule. Cars drive at 12.5 m/s or wait, and cars in the same direction keep 25 m apart. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| MinotaurGiven a grid maze, Theseus, and a deterministic twice-as-fast Minotaur, find the minimum number of Theseus turns needed to reach the exit, or 0 if impossible. | Medium7 | BFSSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Two-Stacks SolitaireGiven a stock pile dealt in order, decide whether the top card can be moved to intermediate pile 1 or 2 or popped to the foundation so all cards end non-decreasing. | Medium7 | Dynamic programmingStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| What's Up With GravityOn a grid with two gravity directions, find the minimum number of gravity flips to move from C to D, where falling is forced downward and you can step sideways only when blocked below. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| MirrorsGiven N small mirrors tilted at 45 degrees, find the first mirror whose flip lets a horizontal ray from the origin reflect to reach point (a,b). | Medium7 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Unlocking BlocksThree connected polyomino pieces slide one unit at a time on a small grid; decide whether they can be moved so their bounding boxes are pairwise disjoint. | Medium7 | BFSSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Wrong DirectionsGiven a command string of F, L, and R, count the distinct final positions reachable by changing exactly one character to a different one. | Medium7 | SimulationHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cows on IceBessie slides on ice until a rock stops her; find the minimum number of pushes to move from her start cell to the goal cell. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chocolate EatingSchedule N chocolates, eaten in fixed order over D days, to maximize the smallest bedtime happiness, where happiness halves each night and rises by eaten values. | Medium7 | Binary searchGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Watering Plan CheckDecide whether a grid plan groups every non-scarecrow cell into connected triples with matching letters, then count the fence holes, or print -1. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Maximum FlowCompute the maximum flow from node A to node Z through a network of pipes with given capacities, using series and parallel reductions. | Medium7 | GraphImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pumps and PipesPlace the fewest pumps along a 20 m per pipe water line so pressure stays within limits, choosing the lexicographically smallest position set. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Moon MooingStarting from an initial value, repeatedly apply two monotone linear-floor functions to all generated values and report the N-th smallest distinct value. | Medium7 | HeapMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Crisis on the FarmGiven up to 1000 stacks of 30 cows and 1000 haystacks on a grid, choose K whistle moves (all stacks shift together) maximizing cows lifted onto haystacks, then output the lexicographically smallest best sequence. | Medium7 | Brute forceSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Time PlannerGiven each of up to 20 members' busy intervals, output every maximal window of length at least one hour where at most one member is absent throughout. | Medium7 | IntervalsSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Moving Object RecognitionFind the largest connected white blob in each image, track its centroid over time, and report the average per-second velocity in x and y, each to two decimals. | Medium7 | BFSSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| WonderTeamFor each n, find the largest possible rank a team can reach while strictly leading the league in wins, goals scored, and fewest goals conceded in a double round-robin. | Medium7 | GreedyMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Calculating Taxi FareGiven a sequence of streets with lengths and per-kilometer times, compute a passenger's fare between two streets using tiered per-kilometer pricing plus night and traffic surcharges. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Left LabyrinthsSimulate a wall-following walker that always keeps its left hand on the wall and report whether it reaches the wider central courtyard. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| MBoneSimulate a multicast network of routers and hosts: process join, leave, and send events, propagating each packet along tunnels with TTL thresholds, and report the highest remaining TTL each host receives. | Medium7 | GraphSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| WordApply a cyclic cellular rewriting rule s times to a binary word of length n, then print the lexicographically smallest rotation. | Medium7 | StringSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TimeGiven two valid dates and a period such as 3 months or 2 days, count how many whole periods aligned to unit boundaries fit between them using Gregorian leap year rules. | Medium7 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GossipingGiven bus loops with drivers moving in lockstep, decide whether every driver eventually meets every other driver's news. | Medium7 | SimulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RobotA circular robot on a grid of tracks must go from a start crossing with a given facing to a target crossing, moving 1 to 3 meters per GO and turning 90 degrees per TURN, each command costing one second; find the minimum time, or -1. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Follow My LogicParse ASCII circuit diagrams made of wires, junctions, AND/OR gates, and inversions, then evaluate the output for each given input assignment. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| EnigmaGiven a partial Enigma key and plaintext with a few unknowns, complete the decryption of the ciphertext. | Medium7 | Brute forceSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Eeny MeenyFor each range of tribe sizes, find the smallest position that survives the 15-syllable counting-out for every size and both directions, or report that none exists. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Calculator LanguageEvaluate expressions in a tiny language with right-associative equal-precedence operators, assignment, and right-to-left operand evaluation, then report changed variables. | Medium7 | ImplementationRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Gears on a BoardDetermine each gear's rotation direction and speed from the motor, propagating through same-level ring contacts, and report overlap or conflicting rotation errors. | Medium7 | GraphBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| String DecodingGiven a string, a permutation, and a large repetition count m, recover the string that the permutation maps to the given encoded string. | Medium7 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Josephus, Once More!People are selected around a circle by the rule f(x)=(a x^2+b) mod N, starting at 0; each drinks on the second selection, and on the third everyone leaves. Count how many never drink. | Medium7 | SimulationMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| FractranGiven a list of fractions and a start value, repeatedly apply the first fraction that keeps the value an integer, and report the first m exponents of powers of two that appear. | Medium7 | SimulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hall of FountainsGiven n fountains inside n rooms, each periodically on/off with period 2p and offset q, find the earliest time to walk from before room 1 to past room n using one-second steps, entering a room only while its fountain is off. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Euro Cup 2000Given partial soccer standings and at most ten remaining games, find each team's best and worst possible final rank under the points and tiebreak rules. | Medium7 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Analog Clock DisplayGiven times in HH:MM form, draw fixed-size ASCII analog clock faces with the hour and minute hands rasterized as line segments, following exact character rules. | Medium7 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bus SchedulesFor each test case, count the days of a given year that satisfy at least one weekday/holiday specifier and also fall inside a comma-separated list of dates and date ranges. | Medium7 | ImplementationSimulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Japan Plotter DriverEmulate a plotter's POINT, TEXT, LINE, CLEAR, and PRINT commands on an ASCII grid, merging overlapping characters by fixed rules, and frame each finished picture. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Traffic JamOn a 6x6 grid of sliding cars and trucks, find the minimum number of slides to drive vehicle x off the right edge, or report that it is impossible. | Medium7 | BFSSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DefragmentationGiven K files scattered across N disk clusters, find the minimum number of cluster moves to pack them consecutively in file order. | Medium7 | GraphSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Lazy and Strict EvaluationGiven function definitions in a small Lisp-like language, count how many times each arithmetic operation runs under lazy (memoized) versus strict evaluation, skipping non-terminating tests. | Medium7 | ImplementationRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Simplified λ-evaluationsEvaluate simplified lambda-calculus expressions by substitution, stopping after 1000 applications and printing unterminated if it does not finish. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Odd Loving BakersSimulate monthly celebrations where bakers with an odd chalk count win and add marks to their favorite bakers; find the number of winners at celebration t up to 1e9. | Medium7 | Bit manipulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TourneyMaintain a single-elimination bracket of 2^N players under point updates, and answer queries about the winner's position and how many rounds a given player wins. | Medium7 | TreeSegment tree+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ParadeMaintain a list of N perimeter-rotation commands on a 4x4 grid under Q cumulative point updates, printing the resulting grid after each update. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| S and KGiven binary trees written with S and K, repeatedly apply the two rewrite rules until no rule fires, then print the final tree string. | Medium7 | ImplementationSimulation+2 | No attempts yet | 3s | 128 MB | Judgeable |
| A Knightly PursuitGiven board size and starting squares for a pawn and a knight, decide whether the knight can win, force a stalemate, or loses, and report the minimum knight moves. | Medium7 | BFSSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| HoppersFind the minimum number of hops from S to F on a grid, where each hop changes the velocity by at most 1 per component and lands only on empty squares. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ent NumbersSimulate a Goodstein-like sequence where each step subtracts one, then raises the base while keeping digits, and report the base where the term first hits 0 or that it exceeds 2^60. | Medium7 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BSP TreesBuild a BSP tree by inserting p slanted planes into the xz-plane, assign n polygons to leaf regions, then print objects in the drawing order the tree induces. | Medium7 | GeometryTree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Biased DiceSimulate dropping biased dice one by one onto a grid and count which numbers show on the top faces of the final pile. | Medium7 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Packing RectanglesGiven four rectangles, find every smallest enclosing axis-parallel rectangle that fits all four without overlap, using the six basic layouts. | Medium7 | Brute forceGeometry+2 | No attempts yet | 1s | 512 MB | Judgeable |
| PuzzleGiven an n by n permutation board, decide whether row and column cyclic shifts can turn it into the target board where cell (i,j) holds (i-1)*n+j. | Medium7 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| House ConstructionFind the minimum number of days to build L houses given that factories cost Y planks and occupy plot space, produce 10 planks per day, and planks expire nightly. | Medium7 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Obstacle CourseFind the minimum number of one-second straight-line moves for a puck starting at rest at the origin, where each flick changes a velocity component by 1 m/s up to 7, avoiding stick obstacles and ending exactly on the target point. | Medium7 | BFSGeometry+2 | No attempts yet | 2s | 128 MB | Judgeable |
| VangOn a polygonal grid yard, a guard moving twice per turn chases a prisoner who can move or wait; report the guard turn when capture happens. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| FeatherA feather drifts across a windy grid where whirlwind directions rotate clockwise each second; determine whether it lands, exits the island, or drifts forever, and report the relevant cell. | Medium7 | SimulationGraph+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Griddy HobbyStarting from a boundary point, draw a 45-degree diagonal, then perpendicular segments until the path closes or stalls; count the minimal rectangles carved out. | Medium7 | SimulationGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Wiping WordsRepeatedly blank out any word whose column has no support in the next line, or that appears in the last line, until no more words can be wiped. | Medium7 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Afshung Pizza DeliveryGiven an ASCII street map with rotating traffic lights at intersections, find the minimum travel time from S to D, or report impossible. | Medium7 | Shortest pathGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Illusive ChaseGiven a grid with obstacles and a log of chase trips, each recorded as a range of steps in one direction, count the possible starting cells consistent with the whole sequence. | Medium7 | ArrayBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The GameGiven N and a count M of 'I don't know' answers, find all pairs the master could have chosen in the sum-product guessing game. | Medium7 | SimulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Computer DialogueGiven file names split into name and extension parts, simulate the alternating 'I don't know' messages between two clients and list files still possible after M messages. | Medium7 | SimulationHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| UFO Cubes in RoswellGiven a cube with mirrors at integer points, trace every downward light ray and report how many exit each face and how many deflections they took. | Medium7 | SimulationImplementation+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Pixel ShuffleGiven a permutation of an n by n pixel grid built from at most 32 named transformations, find the smallest positive power that returns the image to its original state. | Medium7 | MathImplementation+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| ArtinalsInterpret a small language over hereditarily finite sets, evaluating assignments, expressions and relations, and print reduced canonical set representations. | Medium7 | StringImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Hexaroman NumbersParse and output hexadecimal Roman numerals, choosing the shorter of additive or subtractive notation per digit, then evaluate +, -, and * expressions. | Medium7 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PalindromesFor each number in a small interval written in base b, apply reverse-and-add up to l times and count how many do not reach a palindrome. | Medium7 | SimulationMath+2 | 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 |
| FuturamaGiven M distinct mind swaps among N customers, find the minimum number of additional swaps, using two extra bodies, to return every mind to its own body. | Medium7 | GraphGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fruit BowlGiven a V-shaped bowl with left and right wall angles and height H, simulate greedily dropping unit circles to find how many fit below the rim. | Medium7 | GeometrySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CardsFind the initial deck order that makes the shuffle, driven by the primes, output cards N down to 1. | Medium7 | SimulationMath+2 | No attempts yet | 1s | 16 MB | Judgeable |
| CocktailA cube is lowered into a vessel holding two immiscible liquids of different densities; some liquid may spill. Find the final liquid height using Archimedes' principle. | Medium7 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting Satisfying AssignmentsParse one logical formula and count how many of the 4096 assignments to twelve variables make it true. | Medium7 | ImplementationSimulation+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Jakarta Traffic JamFind the fastest travel time between two intersections where each street is driven at half speed during its own daily rush hour, and you never stop to wait. Each test case gives up to 20 nodes; report the minimum minutes to two decimals. | Medium7 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Toy CarsBelady's caching: given a sequence of toy cars a child will request, minimize the number of times a car must be fetched from the shelf when at most k can be on the floor. | Medium7 | GreedyHeap+1 | No attempts yet | 3s | 128 MB | Judgeable |
| TreasureGiven clockwise-ordered corridors between vaults and guards following the right-hand rule, find which guards eventually collect all pieces of information. | Medium7 | GraphSimulation+2 | No attempts yet | 3s | 128 MB | Judgeable |
| ShuffleGiven a permutation b and an integer l, count the permutations a whose l-th iterate equals b, modulo 1e9+7. | Medium7 | CombinatoricsMath+2 | No attempts yet | 3s | 128 MB | Judgeable |
| RobinsonGiven an n by n grid with a boat shape, water, and obstacles, find the minimum number of unit translations in four directions to slide the boat completely off the map. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TrainsAfter each of m car swaps, track the largest number of trains that ever shared each train's exact colour string. | Medium7 | Hash mapString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Ball Boxesn boxes in a row hold equal red and green balls with two adjacent empties; repeatedly move two balls into those empties and output a sequence that groups all reds before all greens. | Medium7 | GreedySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BilliardsDecide which of six table pockets a frictionless bouncing ball reaches, or report that it never falls in. | Medium7 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Physical EducationJasio can skip up to k duels where he is the left student; find the leftmost final position he can reach. | Medium7 | ArrayDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| MechagodzillaAfter each swap of two program letters, decide if the automaton run from the start state ends in a battle state. | Medium7 | Segment treeSimulation | No attempts yet | 1s | 128 MB | Judgeable |
| CylindersTwo identical cylinders with the same n scale marks start empty; find the minimum number of fill, drain, and pour actions to leave exactly l millilitres in one cylinder, or report it impossible. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Number of PeanutsSimulate a squirrel that toggles peanuts on a grid while turning left or right, and count the peanuts after t seconds with t up to 1e9. | Medium7 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PushPushPush rocks one cell at a time across a grid map to walk from the entrance to the treasure. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Aquarium 1Given a stepped aquarium bottom with drain holes, compute the volume of water that stays trapped after drainage. | Medium7 | SimulationGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bulletin boardsArrange ordered framed pictures into consecutive strips with shared frames and centering to fit the smallest area rectangle. | Medium7 | Dynamic programmingSimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Counting ponorksCount unit steps to walk a right-angled wall route where steps cut straight across corners and a final partial step of at least half a unit counts as one. | Medium7 | GeometrySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Baffled!The program reads a baffled grid tank and reports how much water fits before trapped air stops filling. | Medium7 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |