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 results486 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Restaurant Locations from Delivery TimesFor each friend, print the lexicographically smallest integer point at Manhattan distance exactly t that stays at distance at least t from every friend. | Medium7 | GeometryIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Lonely mdicGiven N circles, count the ones fully covered by the union of the rest. | Medium7 | GeometrySorting+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Consecutive OrderingDecide whether every vertex's closed neighbourhood forms one unbroken block in the given vertex ordering. | Medium7 | IntervalsTwo pointers+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Train Ticket AllocationDecide how many tickets to sell for each station pair so paid and free riders fit capacity P on every segment and total income is maximal. | Medium7 | GraphShortest path+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Count von Walken's FenceGiven a spacing D and the footstep counts between consecutive poles, decide whether unit steps can yield those counts without landing on a pole. | Medium7 | IntervalsMath | No attempts yet | 1s | 256 MB | Judgeable |
| Hero PowerEarn charge during star phrases and spend it on activations that double note points without wiping future phrases to maximize the score. | Medium7 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 256 MB | Judgeable |
| BitrisFind the fewest adjacent swaps that let all paired cubes cancel by repeatedly deleting equal neighbors. | Medium7 | IntervalsSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| RainfallChoose when to leave and how fast to ride within T minutes to minimize trip rain plus sweat that grows with the square of speed. | Medium7 | MathPrefix sum+1 | No attempts yet | 5s | 256 MB | Judgeable |
| Height MapCount the faces of the solid formed by grid columns of given heights, merging edge-adjacent unit squares on the same plane and direction into one face. | Medium7 | BFSSorting+2 | No attempts yet | 3s | 256 MB | Judgeable |
| Productivity improvementPartition all workers into exactly p nonempty lines to maximize the sum of each line's common overlapping work time. | Medium7 | Dynamic programmingSorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Monkey and Apple TreesCount ripe trees in each visited interval while other events ripen whole intervals, with every interval shifted by the previous count. | Medium7 | Segment treeIntervals | No attempts yet | 2s | 256 MB | Judgeable |
| Walking in JOI KingdomN walkers start at given points and move east or west at speed 1, stopping when they meet anyone, and the task asks the positions of Q of them at time T. | Medium7 | StackSimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Circular Barn RevisitedFarmer John opens k doors on a ring of n rooms so cows walking clockwise to their assigned rooms travel the smallest total distance. | Medium7 | Dynamic programmingPrefix sum+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Virtual Rabbit (Large)Find the fewest feedings over D days so no gap exceeds X seconds while skipping work and sleep hours. | Medium7 | GreedyMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Card GameBob repeatedly deletes three neighboring cards whose values form an arithmetic progression with difference K, and seeks the fewest cards that can remain. | Medium7 | Dynamic programmingIntervals | No attempts yet | 5s | 512 MB | Judgeable |
| Card Game (Large)Repeatedly delete neighboring triples in arithmetic progression with difference K to leave as few cards as possible. | Medium7 | Dynamic programmingIntervals | No attempts yet | 5s | 512 MB | Judgeable |
| Graduation Requirements (Large)Choose entry time and intersection to drive clockwise as long as possible without ever occupying the same point as any recorded counterclockwise car. | Medium7 | IntervalsMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Sunlight (Large)Each building holds houses along its full height and the sun crosses a semicircle, so the task asks what fraction of houses sees the sun for at least H hours. | Medium7 | GeometryIntervals+1 | No attempts yet | 10s | 512 MB | Judgeable |
| Bribe the Prisoners (Small)Choose the release order of Q prisoners out of P cells to minimize total bribes, where each release bribes every still-occupied prisoner reachable from it until a boundary or empty cell. | Medium7 | Dynamic programmingDivide and conquer+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Bribe the Prisoners (Large)Given prison cells in a row and a set of cells to release one per day, choose the release order that minimizes total bribes paid to prisoners who hear the news. | Medium7 | Dynamic programmingDivide and conquer+2 | No attempts yet | 5s | 512 MB | Judgeable |
| What Are Birds? (Large)Given labeled points and the fact that birds are exactly the points in a height interval crossed with a weight interval, classify each query as always bird, never bird, or unknown. | Medium7 | ArrayIntervals+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Bribing the PrisonersRelease Q prisoners from a row of P cells in the order that minimizes bribes paid to neighbors reached by the news. Find that minimum total cost. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Delete FilesGiven a top-aligned list of name boxes with widths, find the minimum number of axis-aligned rectangle selections whose deletions remove all 'y' files and keep all 'n' files. | Medium7 | Dynamic programmingGeometry+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Starlight FallsGiven two observers' angular-direction and distance-range observations, decide whether a consistent star placement exists and find the maximum number of stars. | Medium7 | GeometryIntervals+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Inverse RMQGiven query intervals and their maximum answers over a hidden permutation of 1..N, decide whether some permutation of 1..N satisfies all queries. | Medium7 | GreedyIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Bridge AutomationGiven sorted boat arrival times, schedule bridge raises and lowers so no boat waits over 1800 seconds while minimizing total road closure time. | Medium7 | Dynamic programmingGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| ButterflyChoose non-overlapping dates; each person pays only if all their dates are kept, so maximize total satisfaction. | Medium7 | IntervalsDynamic programming+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Merry ChristmasGiven a town road network and timed delivery requests, find the minimum number of Santas so every present arrives exactly at its scheduled time. | Medium7 | Shortest pathDynamic programming+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Combining RiceballsGiven a row of riceballs, merge equal adjacent pairs or equal pairs with one ball between them, and find the largest size reachable. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Blockade Duty ScheduleFind the largest M such that a daily duty schedule exists where at least M students are on duty at every moment, respecting each student's free periods and daily minute limit. | Medium7 | IntervalsBinary search+1 | No attempts yet | 1s | 512 MB | Judgeable |
| WolvesCount subsets of N sections, each holding at most one wolf, such that every given interval contains at least one chosen section, modulo 1e9+7. | Medium7 | Dynamic programmingCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Legendary Twin Sword HeroGiven n triples (A, B, C), choose the smallest set of integers so that each triple has A chosen and some chosen value in [B, C]. | Medium7 | GreedyIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Watson and Intervals (Large)Generate N intervals from a recurrence, then find the minimum covered integer count after removing exactly one interval. | Medium7 | IntervalsSorting+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Why Did the Cow Cross the Road 8Two rows each hold a permutation of N breeds; pair friendly pastures across the road without crossings to maximize the number of crosswalks. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Modern Art 2Given a 1D painting, decide whether it can be built by layering one interval per color, and if so find the minimum number of Moonet's disjoint-interval rounds. | Medium7 | StackGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Parenting PartneringSplit the 1440 minute day between two parents, respecting fixed busy blocks, so each gets exactly 720 minutes with fewest custody switches. | Medium7 | GreedyIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Removal GameGiven a circle of numbers, remove them one by one paying the gcd of the two neighbors, and minimize the total cost. | Medium7 | Dynamic programmingNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Security BadgeGiven a directed graph whose edges each allow a range of badge IDs, count the badge IDs x for which room t is reachable from s. | Medium7 | GraphBFS+2 | No attempts yet | 3s | 512 MB | Judgeable |
| BricksCount the distinct sets of occupied boxes reachable after M bricks fall, where a brick at an occupied position expands its run left or right. | Medium7 | Dynamic programmingIntervals | No attempts yet | 0.2s | 512 MB | Judgeable |
| Candy Wall BurglaryA bandit descends and reascends through shelves connected by sparse ladders, collecting jars at most once; find the maximum candy total. | Medium7 | Dynamic programmingGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Space ProbeGiven a random start time in [t1,t2] and fixed measurement offsets, find the probability that no measurement lands inside any forbidden interval. | Medium7 | IntervalsMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Planet DestructionEach of K rockets hits the circle at an angle, and each virus spreads both ways along the circle at its own speed; find the first time every point of the circumference is covered. | Medium7 | Binary searchIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Diagonal slices of a rectangle unionSum the total length of the union of axis-aligned rectangles cut by each diagonal line y = s - x for integer s in [L, R], and print the result divided by sqrt(2). | Medium7 | GeometryIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Pokemon HuntPokemon sit on houses along a line, each with a candy value and a deadline; starting at house K, maximize candy collected while walking one house per second. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 512 MB | Judgeable |
| Block GameRemove every block so the heights leave in non-decreasing order, minimizing moves of a machine that walks left and right along the shrinking row. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Touch the SkyStarting at altitude 0, each balloon i can be inflated only at altitude at most L_i, then raises the house by D_i and pops; maximize the number of balloons popped. | Medium7 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| It’s a Jungle Out ThereGiven moving point cars and snake lengths, count how many snakes can find a safe crossing window between two given times without a car touching their body. | Medium7 | IntervalsSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Rising SunFind the first integer minute when the upward-moving sun is visible from a house on a mountain boundary built from 45-degree zigzag segments. | Medium7 | GeometryMath+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Green LightGiven color observations and fixed traffic-light phase lengths, find the probability that the unknown cycle offset gives color cq at time tq. | Medium7 | MathIntervals+2 | No attempts yet | 1s | 512 MB | Judgeable |
| DriveGiven D, tank capacity C, consumption E, and stations with distances and prices, find the cheapest way to reach distance D starting with a full tank, or report -1. | Medium7 | GreedyStack+2 | No attempts yet | 1s | 256 MB | Judgeable |
| FestivalPick exactly one non-overlapping show from each of up to 10 stages so the total known-song count is maximized, or report -1 if no valid selection exists. | Medium7 | Dynamic programmingBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Super Cheap Party RoomsManage a row of N rooms across new/in/out queries, placing each new room in the leftmost gap of size Y and cleaning it when its guests leave. | Medium7 | IntervalsSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Forests in DangerGiven axis-parallel river segments and the country rectangle, find the smallest integer r so the union of r-thickened river rectangles covers at least P percent of the territory. | Medium7 | GeometryBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Thread KnotsPlace one integer knot on each of n given intervals so that the smallest gap between any two knots is maximized, and print that optimum. | Medium7 | Binary searchGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| FrogsGiven n frogs at positions 1..n, each with reach r_i and skill s_i, pick three frogs that share a common reachable stone and maximize the sum of their skills. | Medium7 | GreedySorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Deep800080Place a point on a line so that a disk of fixed radius R centered there covers as many of N given points as possible; output the maximum count. | Medium7 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Jumping JunipersMove each tree to a distinct positive integer position within its allowed interval so that the total distance from the house is minimized. | Medium7 | GreedySorting+2 | No attempts yet | 4s | 512 MB | Judgeable |
| We Need MasksEach citizen accepts mask prices in a range [L, R], each store sells X masks at price P, and we must match as many citizens to masks as possible. | Medium7 | GreedySorting+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| ArcadeEach hand moves one button per second between presses; find the minimum number of hands that can cover all M presses. | Medium7 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| LasersEach row holds sliding walls of fixed widths; count laser positions blocked in every possible configuration across all rows. | Medium7 | IntervalsGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Array InitializationCount ordered sequences of M interval marks on an array of length N whose union covers every position, modulo 1e9+7. | Medium7 | Dynamic programmingCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Paper FoldingGiven an N by M grid of integers, repeatedly fold it along row or column lines so overlapping cells sum, and find the maximum value obtainable in any cell. | Hard8 | Dynamic programmingIntervals+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Toy SterilizationGiven daily toy demands over D days and two sterilization services with different delays and costs, decide which used toys to sterilize or discard versus buying new ones to minimize total cost. | Hard8 | GreedyGraph+2 | No attempts yet | 2s | 128 MB | Judgeable |
| BusGiven passenger groups each traveling between two bus stops, choose how many from each group to carry so total passengers are maximized without exceeding capacity C on any segment. | Hard8 | GreedySegment tree+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Protective TentsGiven non-overlapping horizontal tents, add horizontal segments above them so that every point of the interval between the leftmost and rightmost endpoints receives downward water. | Hard8 | GreedyIntervals+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Choosing GuitarsN guitars sit in a circle, and each turn the mover must take one guitar from every remaining contiguous group; find the max total value the first player can secure with optimal play. | Hard8 | Dynamic programmingGame theory+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Freight TrainGiven two trains as unions of intervals of occupied cars, find the smallest forward shift of one train that maximizes the count of aligned occupied cars. | Hard8 | IntervalsMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Fence Escape Season IVGiven N horizontal fence segments Jimin must dodge by sidestepping to their endpoints, compute the minimum total horizontal movement to reach the exit below. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Food Wrap AreaGiven N food items on a 2-row by B-column grid, cover every food cell using at most K axis-aligned rectangular wraps while minimizing the total wrap area. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| SpiderwebGiven a convex polygon's vertices and circular puddles, find the maximum number of non-crossing diagonals that avoid all puddles. | Hard8 | Dynamic programmingGeometry+2 | No attempts yet | 2s | 128 MB | Judgeable |
| TicketsAssign seat blocks of length L to families to maximize profit, where exact preferred block gives 2, any other free block of L seats gives 1, and blocks can't overlap. | Hard8 | Dynamic programmingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Rectangles and ShapeGiven a rectilinear polygon and a set of non-overlapping axis-aligned rectangles, select rectangles that exactly tile the polygon's interior without exceeding its boundary. | Hard8 | GeometryIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Microbiology LabChoose the minimum number of distinct integer temperature points so every microbe's interval contains at least C[i] chosen points. | Hard8 | GreedySegment tree+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Visible SquaresGiven up to 1000 non-overlapping axis-aligned integer squares, count how many are visible from the origin by angular occlusion reasoning. | Hard8 | GeometrySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Total Length of Grid Segments in a PolygonGiven a simple polygon with integer vertices, compute the total length of grid line segments strictly inside the polygon. | Hard8 | GeometrySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Richest Tenant CompanyProcess chronological move-ins and range-max inspections on offices where each company's wealth grows linearly with time, requiring a segment tree over linear functions evaluated at the query day. | Hard8 | Segment treeIntervals+1 | No attempts yet | 5s | 128 MB | Judgeable |
| GrassSimulate N up to 1e9 plants under growth, cap, mow-left, mow-right, and clamp operations using an implicit interval structure, answering running sum queries efficiently. | Hard8 | Segment treeIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ships on a RiverGiven river fields with fish amounts and ships each needing a fixed anchor field and length placed without overlap, maximize total fish covered. | Hard8 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JOKERGiven K shuffled and partly ambiguous card-removal records, decide if they can be reordered to remove all N-1 non-joker cards and output a valid execution order. | Hard8 | GreedySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| WalkCompute the shortest grid path length from (0,0) to (X,Y) avoiding up to 100,000 non-overlapping rectangular buildings that only occupy positive x squares. | Hard8 | GeometryShortest path+2 | No attempts yet | 2s | 64 MB | Judgeable |
| November RainGiven non-intersecting sloped roof segments, compute for each segment how much rainwater (falling vertically, then sliding down slopes and shielded by segments above) drains off its lower end. | Hard8 | GeometrySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Minimizing MaximizerGiven a pipeline of range-sort operations, find the minimum number of operations (kept in order) whose composition still guarantees the last position always holds the overall maximum. | Hard8 | GreedyIntervals+1 | No attempts yet | 1s | 512 MB | Judgeable |
| WormsGiven string rewriting rules, find the minimum number of days to grow the target worm from one cell, where each day any subset of cells splits. | Hard8 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Missile CommandGiven missiles moving at constant velocity and circular shots that grow then shrink over 2 seconds, find the minimum number of shots needed to neutralize the same missiles and report the battle score. | Hard8 | GeometryGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fax RegionsGiven the width and run length encoding of a huge fax image, count the connected dark regions using 4-directional adjacency without expanding individual pixels. | Hard8 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Edge DetectionGiven an image as run-length encoded runs, set each output pixel to the largest absolute difference from its 8 neighbors, and emit the result as runs. | Hard8 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Red GemFor each test case, find the fraction of a circular platform's circumference from which an entire red disk is visible without any orange disk blocking the line of sight. | Hard8 | GeometryIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Grid NimTwo players alternately remove a heap from either end of a row; a player cannot take three heaps in a row on their own turns, and the first player wins if their coin total is at least the second player's. | Hard8 | Game theoryDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PolygonRemove one edge of a polygon, then repeatedly merge adjacent vertices by the intervening + or *, and report the maximum final value plus every edge whose removal reaches it. | Hard8 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PhotoGiven intervals each containing exactly one marked point, find the maximum number of marked points, or -1 if no assignment is consistent. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Barn AllocationGiven stall capacities and interval requests, find the maximum number of requests that can be granted without any stall exceeding its capacity. | Hard8 | GreedySegment tree+2 | No attempts yet | 2s | 128 MB | Judgeable |
| IntervalsGiven n integer intervals each needing at least c_i chosen points inside it, find the smallest set of integers satisfying all requirements. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IntervalsGiven a point light above the x-axis and non-overlapping circular pipes below it, find the shadowed intervals on the x-axis, sorted and rounded to two decimals. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Subway PlanningGiven points in the plane and a radius d, cover all points using the fewest rays from the origin, where a ray covers a point if some point on the ray is within distance d. | Hard8 | GeometryGreedy+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 |
| RobotsRobots on a circular track move clockwise for given durations, pushing each other and stopping at walls; find each final position. | Hard8 | SimulationIntervals+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Farmer Bill's ProblemPlace non-overlapping, non-touching rectangles inside a rectangular field so all given circles lie within them, minimizing total rectangle area, and output the remaining harvestable area. | Hard8 | GeometryDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Experiment "X": Explosions ExpectedCount valid mixtures (at most S total ounces, at least two ingredients used) that are not dominated coordinatewise by any of M given exploding mixtures, modulo nothing. | Hard8 | CombinatoricsDynamic programming+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Fish CatchGiven a fixed net center and N fish moving at constant velocity, find the smallest radius that catches at least K fish at some time t >= 0. | Hard8 | GeometryBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CensorshipGiven a text and a filter word set, remove occurrences repeatedly to make the shortest possible result and report its length. | Hard8 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |