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 |
|---|---|---|---|---|---|---|
| Voter DepressionPick non-overlapping story intervals to multiply exposed voters' propensities and maximize the right-minus-left propensity gap. | Medium5 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Candy ChainGiven a candy string and a list of paid parts (each reversible), find the maximum total value obtainable by repeatedly removing sold parts and rejoining the remainder. | Medium5 | Dynamic programmingIntervals+2 | No attempts yet | 7s | 512 MB | Judgeable |
| The StoveEach visitor stays for one time unit at a distinct arrival time; with at most K lights, minimize total stove-on time by skipping the largest idle gaps. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Segments and QueriesProcess up to 100 queries that add intervals of strictly increasing length and ask whether two added intervals are connected by the overlap-based move relation. | Medium5 | GraphUnion-find+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Measuring TrafficGiven sensor readings for each mile as inflow, outflow, or highway flow ranges, find the tightest possible interval for the flow before mile 1 and after mile N. | Medium5 | IntervalsSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ContestGiven N intervals with start time, end time, and prize money, choose non-overlapping contests (end must not touch the next start) to maximize total prize. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Carpool MatchingEach passenger has a destination point and each driver accepts a closed interval of destinations; match the maximum number of passenger-driver pairs. | Medium5 | GreedySorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| What's Mine is MinePick non-overlapping ore intervals to maximize total value, where each interval's value is its duration times its mineral's price. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| Riyuna Likes Sailor UniformsGiven N shirt widths and M collar widths, a collar of width c fits a shirt of width w if w/2 <= c <= 3w/4 or w <= c <= 5w/4; find the maximum number of valid shirt-collar pairs. | Medium5 | GreedyTwo pointers+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Minimum Number of Conference RoomsGiven N meetings with start and end times, find the minimum number of rooms so that no two overlapping meetings share a room, where a meeting may start exactly when another ends. | Medium5 | SortingGreedy+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Meeting Room Scheduling 4Choose a set of non-overlapping meetings, where touching endpoints are allowed, to maximize the total number of attendees. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Stars on Shoulder BoardsGiven bounds on star counts and the min and max stars removable from officer Y, find the smallest and largest possible battalion size. | Medium5 | MathImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| RegionsGiven N cities linked by a chain of express roads plus extra directed roads, split cities into equal-size regions that preserve a strict one-way reachability order, maximizing region count. | Medium6 | GraphIntervals+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Lecture Rooms 2Assign each of N intervals a room number using the minimum number of rooms so overlapping lectures never share a room, touching endpoints allowed. | Medium6 | GreedyHeap+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Morning Three and Evening FourGiven N banana weights, choose non-overlapping length-K blocks to move as a C-second group, minimizing total time and then the number of groups used, with output of chosen block positions. | Medium6 | Dynamic programmingPrefix sum+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Card BundlesGiven a shuffled permutation of 1 to N, output N-1 adjacent merges that combine bundles into a single bundle where each intermediate bundle holds consecutive integers. | Medium6 | StackGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| RectanglesFind a line through the origin that intersects the maximum number of given axis-aligned rectangles, using each rectangle's angular interval from the origin. | Medium6 | IntervalsSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Bus and PassengersGiven up to 50000 requested one-directional bus segments and a bus of capacity C on a route of N stops, maximize the total number of passengers carried in one round trip without exceeding capacity at any point. | Medium6 | GreedyIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Mayor Election PostersGiven n posters pasted in order over intervals on a huge wall, count how many posters remain at least partially visible after later posters overlap earlier ones. | Medium6 | Segment treeCombinatorics+2 | No attempts yet | 1s | 192 MB | Judgeable |
| Princess's GardenSelect the minimum number of intervals (flower bloom ranges) to cover every day from March 1 to November 30, or report 0 if impossible. | Medium6 | GreedyIntervals+1 | No attempts yet | 1s | 192 MB | Judgeable |
| Water TaxiGiven pickup and drop-off points along a line for many passengers picked up by a boat starting at 0 that must end at M, compute the minimum travel distance covering everyone. | Medium6 | GreedyPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BOATGiven clients in fixed order, each with rental durations and deadline-based payment options, schedule non-overlapping rentals to maximize total earned money. | Medium6 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Convention CenterChoose the largest set of non-overlapping day intervals, breaking ties by picking the set of group indices that is lexicographically smallest. | Medium6 | GreedySorting+2 | No attempts yet | 2s | 64 MB | Judgeable |
| CoverageGiven up to 100 towers with integer centers and radii, compute the percentage of a line segment path covered by at least one tower, rounded to two decimals. | Medium6 | GeometryIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cell Phone AntennaPlace one antenna of range 1000 on the line y=0 so that the total inhabitants of all covered houses is maximized, and report that maximum. | Medium6 | GeometryIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Splitting ClubGiven distinct ages with member counts and a ratio R, partition all age groups into the fewest contiguous sections where the max count in a section is at most R times the min count. | Medium6 | GreedyTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Painting the FenceBessie walks along a number line and each segment she covers gains a coat of paint; find the total length covered by at least K coats. | Medium6 | IntervalsSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Painting the FenceBessie walks back and forth along a line, each pass adding a coat; find the total length covered by at least two coats. | Medium6 | Prefix sumSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Treasure ChestTwo players alternately take a coin from either end of a row of N coins; find the maximum total the first player can guarantee with optimal play. | Medium6 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Work SchedulingGiven jobs each taking one unit of time with a deadline and a profit, choose a subset to schedule so total profit is maximized. | Medium6 | GreedyHeap+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Milking TimeChoose non-overlapping milking intervals, each separated by at least R rest hours, to maximize the total milk produced over N hours. | Medium6 | Dynamic programmingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow Roller CoasterChoose components that tile [0, L] with no gaps or overlaps, maximizing total fun while keeping total cost within budget B. | Medium6 | Dynamic programmingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Decorate the WallGiven non-overlapping axis-aligned rectangles on a wall, find the lowest then leftmost position where a new w' by h' rectangle fits without overlapping any of them, or report failure. | Medium6 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ambiguous ResultGiven a parenthesis-free expression of numbers joined by + and *, restore parentheses to find the smallest and largest values it can evaluate to. | Medium6 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Moving PianosEach piano job is a day interval; decide whether all jobs fit on weekdays, or only with weekends, or not at all, given p tuners doing floor(p/2) jobs per day. | Medium6 | GreedyIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Grazing on the RunBessie starts at position L and walks a line to eat N grass clumps; minimize the sum of times at which each clump is eaten. | Medium6 | Dynamic programmingIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Dividing the PathPartition the segment [0, L] into consecutive pieces of even length between 2A and 2B so no cut lands strictly inside any cow's interval, and minimize the number of pieces, or report that no partition exists. | Medium6 | Dynamic programmingPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cleaning ShiftsCover shifts 1 through T with the fewest intervals, where each interval covers a contiguous range of shifts. Return the minimum number of intervals or -1. | Medium6 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TelevisionGiven N intervals on a line, choose the fewest intervals so that every point covered by any interval is covered by a chosen one, then print that count. | Medium6 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Moving TablesEach move occupies a corridor segment; find the minimum number of 10-minute rounds so that overlapping segments never share a round. | Medium6 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Joke with TurtlesEach turtle claims a count of turtles ahead and behind it; choose positions to maximize how many claims hold at once. | Medium6 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| AdvertisementPlace the fewest advertisements so every jogger's interval of billboards contains at least min(K, length) of them. | Medium6 | GreedyIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Keep the Customer SatisfiedGiven orders with processing times and due dates on a single machine, choose the largest subset that can all finish on time. | Medium6 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Angry LarvaEach snake is a vertical segment at some x-coordinate and height range. Find the launch angle whose parabola passes through the most segments. | Medium6 | GeometryIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BracketsGiven a bracket string, find the maximum length of a regular bracket sequence obtainable as a subsequence. | Medium6 | Dynamic programmingIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Two ProfessorsFind the minimum number of rooms for fixed-interval classes, given that professors 1 and 2 must never share a room. | Medium6 | SortingGreedy+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Lecture Halls ReservationChoose a set of non-overlapping intervals (open at both ends) to maximize the total length covered, given n up to 10000 and times up to 30000. | Medium6 | Dynamic programmingSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| TemperatureEach day gives an interval the temperature could lie in; find the longest run of consecutive days that can be assigned non-decreasing values. | Medium6 | GreedyTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| KangaroosFor each lens interval, find the longest contiguous block of sighting intervals that all overlap it. | Medium6 | IntervalsSorting+2 | No attempts yet | 5s | 128 MB | Judgeable |
| ExamGiven n equal-size axis-aligned rectangles dropped in order, report the indices of sheets whose interior no later sheet covers. | Medium6 | GeometryIntervals+2 | No attempts yet | 5s | 128 MB | Judgeable |
| BridgesAssign each pair a distinct height so the number of vertical-horizontal crossings is minimal and output the bridges from lowest to highest. | Medium6 | IntervalsTopological sort+1 | No attempts yet | 2s | 128 MB | Judgeable |
| ProgramCount the starting values from 1 to M that reach exactly A after running the given add, subtract, multiply, and floor-divide program. | Medium6 | Binary searchIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Genome EvolutionCount the shared gene blocks of length above one that appear as consecutive runs in both chromosomes. | Medium6 | IntervalsArray | No attempts yet | 1s | 128 MB | Judgeable |
| StreetChoose up to k non-overlapping blocks of at most t lots to maximize total block length times its minimum height limit. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| RectanglesCompute the total area covered by up to 1000 axis-aligned rectangles, counting overlaps once. | Medium6 | SortingIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SnowstormSimulate plows clearing road intervals in order of smallest remaining uncovered length and print the clearing order. | Medium6 | IntervalsSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Surveillance CamerasChoose the fewest circular arcs that cover all N rooms on a circle, or report impossible. | Medium6 | GreedyIntervals+1 | No attempts yet | 4s | 512 MB | Judgeable |
| KRAVEYou extend a horizontal or vertical fence from each given point across its current field and report the two resulting areas in order. | Medium6 | IntervalsBinary search+1 | No attempts yet | 5s | 256 MB | Judgeable |
| VampireA circular sun of radius r rises from the horizon behind rectangular buildings, and each dataset asks for the last time the whole disk stays hidden. | Medium6 | GeometryIntervals+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Number Picking GameAhyeon removes interior numbers one at a time, scores each pick plus its live neighbors, and maximizes the total score. | Medium6 | Dynamic programmingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Ship TrafficFind the longest subinterval of start times in [t1, t2] during which a northbound ferry avoids every moving ship in each lane. | Medium6 | IntervalsSorting+1 | No attempts yet | 3s | 256 MB | Judgeable |
| NAFTAFor each K from 1 to S, drill up to K whole columns to drain every touched oil pool and maximize the collected oil. | Medium6 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Deque Sort 2Place each number at the front or back of an existing deque or into a new one so the deques join into ascending order with the fewest deques. | Medium6 | Dynamic programmingSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Merging FilesCompute the cheapest way to merge consecutive chapter files when each merge costs the sum of the two parts. | Medium6 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Cow CraneDecide whether a crane starting at 0 with speed 1 can carry each of two cows from its start to its target by its deadline while holding one cow at a time. | Medium6 | Brute forceGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| TomosynthesisGiven N disjoint disks, find the widest angle range over which their parallel projections stay pairwise disjoint. | Medium6 | GeometryIntervals+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Floppy MusicDecide if every drive head can cover its required sound intervals by moving steadily without a forced turn or stray sound. | Medium6 | Dynamic programmingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Railway TicketsCount station pairs where every leg has a free seat but no single seat stays free for the whole trip. | Medium6 | IntervalsSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Wall ClocksEach member sees a section of the office walls inside a 90 degree cone, and the task asks for the fewest clock points so every member sees at least one. | Medium6 | GreedyIntervals+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Power OutageDecide which lamps run in blackouts to maximize the road length lit both normally and during blackouts. | Medium6 | IntervalsSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| 262144Merge adjacent equal numbers into a number one larger in any order to build the largest value possible. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| The 248 GameMerge adjacent equal numbers into a number one larger to maximize the largest value left. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| IP Address SummarizationMerge the given IPv4 subnets and print the shortest ordered list of normalized subnets that covers exactly the same addresses. | Medium6 | IntervalsBit manipulation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Smoothing Window (Small)Given sliding window sums of an unknown integer sequence, find the smallest possible range between its largest and smallest values. | Medium6 | Binary searchIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Radio Receiver (Small)Choose a walking path at speed at most one so every timed message on a line is within the smallest possible reception distance. | Medium6 | Binary searchIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Radio ReceiverFind the smallest radius D that lets a person moving at speed one stay within D of each broadcast at its sending time. | Medium6 | Binary searchIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Card Fusion EventMerge adjacent cards until one remains, where a merge pays the sum of both levels and keeps only the left card's level; maximize total gold. | Medium6 | IntervalsDynamic programming | No attempts yet | 1s | 512 MB | Judgeable |
| Stock ChartsGiven N piecewise-linear price graphs over K time points, find the minimum number of charts so that no two graphs on a chart intersect. | Medium6 | GeometryIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Happy CowRemove portions from either end of a row over N days; on day d a portion with value H gives H times d. Maximize total happiness. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| Chain DetonationPlace one extra bomb past the last one with unlimited power to destroy as many not-yet-detonated bombs, minimizing the duds among the original bombs. | Medium6 | GreedyIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Donut DecorationGiven N donuts and T interval operations each applying a task number, count donuts whose operations form tasks 1..K in order. | Medium6 | IntervalsSorting+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Maximum Clique of an Interval GraphGiven N intervals, find a largest set of pairwise overlapping intervals, and output its size plus the vertex indices in lexicographically smallest order. | Medium6 | SortingGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Cutting a StringGiven cut positions on a string of length N, find the order of cuts that minimizes the total cost, where each cut of a piece of length L costs L. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| Daruma OtoshiGiven a stack of weighted blocks, remove adjacent pairs whose weights differ by at most 1, in any order, to maximize the total removed. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| RailroadGiven n intervals with distinct endpoint positions, find the maximum number of intervals fully contained in some segment of fixed length d. | Medium6 | SortingSliding window+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Carrot FarmMaintain a set of disjoint planted intervals under plant and harvest operations; after each, report the empty or planted area directly left and right of the affected span. Each area is (number of columns) times L. | Medium6 | IntervalsTree+2 | No attempts yet | 3s | 512 MB | Judgeable |
| MacbethGiven n time intervals and w witches, each witch predicts a chain of non-overlapping intervals, so find the maximum number of intervals coverable by w chains. | Medium6 | IntervalsGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| CardsGiven an even row of cards with integers, two players alternately take an end card; the first player maximizes his total sum while the second minimizes it. Report the best score the first player can guarantee. | Medium6 | Dynamic programmingGame theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Alien Ribonucleic AcidFor each strand, compute the largest number of base pairs (B-S and C-F) that can form when disjoint intervals fold onto themselves. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| Parking LotSimulate a single-line parking lot where each arriving vehicle takes the first free gap from the entrance that fits, and total the fees for vehicles that park. | Medium6 | SimulationImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Hard RefactoringMerge a union of integer intervals given as comparisons, then reprint the merged ranges using the fewest possible constants, with special handling for saturated ends and all-true or all-false cases. | Medium6 | IntervalsSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Large PhD RestaurantGiven N tasks each with a cost and a reward, and starting money M, choose an order to run tasks (paying cost first, then gaining reward) that maximizes the final money. | Medium6 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Minions and the roomsRooms flip between available and unavailable over range updates; after each flip, count set partitions of N minions into the k currently available rooms, mod 880803841. | Medium6 | CombinatoricsIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Why Did the Cow Cross the Road 4Match chickens, each available at a single time, to cows whose interval covers that time, so that as many cows as possible get help. | Medium6 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SceneryGiven n time windows and a fixed photo duration t, decide whether all photos can be scheduled as non-overlapping intervals. | Medium6 | GreedySorting+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Nothing But The TruthGiven facts about which person was at which place and when, count how many claims in a text (who met whom, who was where) are definitely false. | Medium6 | StringIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Cows on a LeashGiven N intervals, find the fewest half-integer cut points so that every interval contains at least one chosen point. | Medium6 | GreedyIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| HipercampoGiven two anchors on the x-axis and N points above, choose the largest subset whose segments to both anchors meet only at the anchors. | Medium6 | GeometrySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Intuidiff IIGiven intervals in the order they appear in a modified document, choose a subsequence of intervals whose original ranges strictly increase; maximize total characters left plain. | Medium6 | Dynamic programmingIntervals+2 | No attempts yet | 4s | 512 MB | Judgeable |
| A Strange TournamentGiven a sequence of distinct powers, choose a non-crossing knockout bracket minimizing the total absolute difference over all matches played. | Medium6 | Dynamic programmingDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |