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 |
|---|---|---|---|---|---|---|
| LifeguardsFire exactly one of N given time intervals, then maximize the total length of time covered by at least one of the remaining intervals. | Medium6 | IntervalsSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| The Lion Is the King of Travel!!Given N days and M fixed non-overlapping-or-not travel intervals, choose a subset of disjoint intervals minimizing the longest gap of untraveled days. | Medium6 | Binary searchGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| MeetingsEach person occupies an interval [Si, Ei]; pair up people whose intervals overlap into disjoint pairs and maximize the number of pairs. | Medium6 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Memory AllocationSimulate first-fit malloc and free over 100,000 memory cells and print requested variable values in command order. | Medium6 | IntervalsSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| To Tell the TruthGiven n people each claiming the true count lies in [a,b], find the largest consistent truth-teller count or -1 if none exists. | Medium6 | Brute forceMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| AlehouseGiven n closed time intervals on a weekly circle, pick one interval of length at most k that intersects as many given intervals as possible. | Medium6 | IntervalsSliding window+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Splitting DNAGiven the lengths of N fragments in order, find the minimum total energy to split the original chain, where each cut costs the current chain length. | Medium6 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Meeting Room Scheduling 2Given N meetings that overlap only with their immediate neighbors in the list, choose a non-overlapping subset maximizing total attendees. | Medium6 | Dynamic programmingArray+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Meeting Room Scheduling 3Choose non-overlapping meetings, where each meeting's time overlaps only its immediate neighbors in the input order, to maximize the total attendee count. | Medium6 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| GameTwo players alternately claim columns they can reach; each wants to claim more columns than the other, and the winner under optimal play is reported. | Medium6 | GreedyGame theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Teacher Cho ForceGiven a moving catcher and N moving students, compute the maximum number of students that can simultaneously lie within radius R at any nonnegative time. | Medium7 | IntervalsMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Four SubstringsGiven a string and four of its substrings, pick one occurrence of each so that the union of the covered positions has the fewest and the most distinct characters. | Medium7 | String matchingIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Letters on the WallGiven up to 100 rectangles each filled with one of four parity-based patterns, compute the total number of unit cells that end up marked on the wall. | Medium7 | IntervalsMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Once Opened, You Can't StopChoose one integer per flavor within its given range so the sum of absolute changes between consecutive picks is minimized, and output the values. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Confining the Black GoatGiven N non-overlapping (but nestable) rectangles, find the maximum nesting depth achievable at a point and how many regions attain that depth. | Medium7 | SortingGeometry+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Chip ConstructionGiven N component priorities and K non-crossing power lines each serving up to two components, find a nesting-valid pairing that maximizes total sum of squares/products. | Medium7 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| High-Speed RailwayCount subsets of interval-graph vertices forming a vertex cover of the interval overlap graph, modulo a given number. | Medium7 | IntervalsDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Connecting RectanglesGiven N candidate axis-aligned rectangles with weights equal to their index, select a maximum-weight subset of pairwise non-overlapping and non-touching rectangles. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Sangbeom's MelancholyGiven daily moods, compute flower-giving intervals before each depressed run (2T days, or 3T for one chosen longest run) and find the maximum count of distinct covered days by optimally picking which longest run gets the 3T rule. | Medium7 | IntervalsGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Call ReconstructionGiven detector counts of calls crossing certain positions along a line of houses, find the minimum number of calls consistent with all counts (interval covering via greedy/sweep with counts as constraints). | Medium7 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| LRH PlantsGiven plants added over time with increasing heights, count for each new plant how many crossing points appear where its stems cross earlier plants' horizontal segments or vice versa, avoiding duplicate points. | Medium7 | Segment treeGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Playlist Display IntervalsGiven a sequence of distinct requested songs, choose a length-K window covering each request to minimize the total number of distinct songs ever shown across all windows. | Medium7 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FenceGiven overlapping rectangular planks forming a skyline, select the minimum subset of planks that reproduces the exact same skyline. | Medium7 | SortingStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| How I Mathematician Wonder What You Are!Determine whether a given simple polygon is star-shaped by computing the intersection of half-planes defined by its edges (kernel of polygon). | Medium7 | GeometryIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Concert Hall SchedulingGiven up to 1000 interval requests with prices for two identical rooms over 365 days, select accepted intervals (assignable to either of 2 rooms without overlap) to maximize total revenue. | Medium7 | Dynamic programmingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| SentriesGiven interval reports saying each range holds no ninja or at least one, find every bush that holds a ninja in all valid placements of exactly K ninjas. | Medium7 | GreedyIntervals+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Serial NumbersApply range assignments of a status letter and a transfer code to serial numbers, then print the minimal merged list of ranges. | Medium7 | IntervalsSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ClickomaniaGiven a string over uppercase letters, decide whether the one dimensional Clickomania puzzle can be fully cleared. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 10s | 128 MB | Judgeable |
| Team DessertDesserts sit in a row; two alternating teams take from either end, and the first-picking team wants the smallest total weight it can guarantee against optimal play. | Medium7 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Emergency RationsChoose boxes with a capacity and an expiry day to eat one unit daily starting day 1; report the last reachable day and the fewest boxes needed. | Medium7 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Popping BalloonsEach balloon is a circle not containing the origin. Find the minimum number of halflines from the origin that all cross at least one circle. | Medium7 | GeometryIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parking ShipsThe captain's parking interval is fixed; place the other ships on a line so that as many ship intervals as possible cover their house centers. | Medium7 | SortingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ShuffleAfter applying m shuffles to an ordered deck of n cards, count how many cards numbered r or less fall in positions p through q. n is up to 1e9, so the huge deck must be tracked implicitly. | Medium7 | CombinatoricsMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Airplane ParkingGiven N time intervals (arrival, departure), find the largest subset that can be scheduled in a stack, so planes leave in last-in first-out order. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hyperactive Boy GangsanCount minimal subsets of intervals that cover [0, M] with no redundant interval, modulo 10^8, over multiple test cases. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Lazy Jumping FrogGiven a grid with up to 1000 rectangular water regions, find the minimum energy path between two dry cells using a fixed set of twelve weighted jumps. | Medium7 | Shortest pathGraph+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Land Division TaxSplit a ring of N lots one at a time; each split costs F times the larger resulting piece. Find the minimum total tax. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PhotoGiven N cows in a line and K unfriendly pairs that cannot share a photo, find the minimum number of consecutive-range photos covering every cow. | Medium7 | GreedyIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Cow RunCows sit at distinct positions on a line; John starts at 0, moves one unit per minute, and each cow costs one dollar per minute until reached. Minimize the sum of arrival times. | Medium7 | Dynamic programmingGreedy+2 | 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 |
| TreasureFind all treasure cells on an N x N grid by asking rectangle count queries whose cost grows as the rectangle shrinks. | Medium7 | Divide and conquerBinary search+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Huffman's GreedWe build the optimal binary search tree for weighted key and gap frequencies, minimizing weighted comparison counts. | Medium7 | Dynamic programmingTree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DinnerGiven a line of G and H programmers, repeatedly remove a run of at least K equal letters; find the minimum number of removals to clear the line, or -1. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hidden CodesGiven code words and a long text, choose non-overlapping covering sequences, each at most 1000 long, maximizing the total length of the code words used. | Medium7 | Dynamic programmingString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TripsMatch group sizes to trip intervals so that each interval gets at most one group and the number of matched intervals is maximized. | Medium7 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RequestsGiven a cache of capacity K and N timed requests with expiration times, compute the minimum number of fetches over all offline replacement strategies. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Sailing RaceGiven sign positions on a line, find the visiting order minimizing the sum of cumulative distances, where each next sign adds the distance from the previous sign. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DiscoGiven N disjoint lit intervals on a line of L lamps and M switches that each flip a range, decide if some subset of switches turns every lamp off. | Medium7 | IntervalsGreedy+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Shortest Regular Brackets SequenceGiven a string of brackets, find the length of the shortest regular bracket sequence that contains it as a subsequence. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Everybody May Get Lost in SpaceGiven three balls in 3D space, compute the exact volume of their union, rounded to six decimals. | Medium7 | GeometryMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| GophersGiven gopher holes and CD players on a line, count holes covered by at least one player before and after each of d moves of a player, outputting d+1 counts. | Medium7 | SortingBinary search+2 | No attempts yet | 3s | 128 MB | Judgeable |
| MusketeersGiven a tournament matrix on n people in a circle, determine everyone who can be the last survivor when adjacent duels are scheduled in any order. | Medium7 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GenotypesGiven budding rules A1 -> A2 A3, decide for each target word whether it can be derived from some number of supergenes S, and report the minimum count. | Medium7 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PawnGiven a large board colored by row intervals, answer whether two squares lie in the same connected same-color region under 8-directional moves. | Medium7 | Union-findIntervals+2 | No attempts yet | 1s | 192 MB | Judgeable |
| LinkNetGiven intervals on a line, schedule each transmission into a tick so that no interval in the same tick contains another interval's endpoint strictly inside it, and no point is used twice per tick; find the minimum ticks. | Medium7 | IntervalsGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PhotosFind the point covered by the largest number of given axis-aligned rectangles. | Medium7 | Segment treeSorting+1 | No attempts yet | 1s | 512 MB | Judgeable |
| HalloweenGiven the sequence of required costumes, find the fewest put-ons when costumes stack and removals are free. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| The Funny Informatics ContestDecide whether each round can be assigned a non-overlapping continuous block of the required length inside its time window. | Medium7 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Never Say NeverDecide whether two employees employed at the same moment ever have equal linear effectiveness values. | Medium7 | SortingIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| VisasChoose visa requests and give each a distinct day inside its window for the largest total payment. | Medium7 | Dynamic programmingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| AcceleratorMatch every red point on a discrete circle to a distinct blue point so the sum of shorter-arc distances is as small as possible. | Medium7 | Dynamic programmingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Square AnnulusGiven N points, find the minimum width of a concentric axis-parallel square ring that contains all of them. | Medium7 | GeometryBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Furniture FactoryDecide if m workers can finish n preemptible jobs with release times and deadlines when each job takes at most one worker at a time. | Medium7 | GraphIntervals | No attempts yet | 2s | 128 MB | Judgeable |
| LaptopPlace each unit-time task inside its release time and deadline so idle gaps between tasks are as few as possible. | Medium7 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Pizza DeliveryChoose which houses on a road to visit and in what order so earnings minus delivery times give the largest total profit. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| Popping GroupsDecide whether a string of a and b can be fully erased by repeatedly deleting maximal runs of at least two equal letters. | Medium7 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| ArcheryDecide whether some spot on the archer line fires one straight shot through every horizontal target segment. | Medium7 | GeometryIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Log JumpingFind the largest set of equal-length logs that can be visited in a closed tour where jumps are allowed between logs whose segments share a point. | Medium7 | IntervalsSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Seminar RoomEach group submits two candidate time intervals, and the program picks one per group so that no two chosen intervals overlap. | Medium7 | GraphDFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Wire ConnectionChoose the fewest vias so vertical wires from the power line to those vias cross every horizontal wire. | Medium7 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Subway MapDecide whether every station label fits above or below the line covering its own station point and no other, with no two labels overlapping. | Medium7 | BacktrackingGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Surveillance SystemPick the fewest cameras whose clockwise ranges together cover all 100000 sectors on the circular boundary. | Medium7 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cliff WalkingFind the farthest square reachable on a 12-hour round trip over a tidal grid, stepping only between squares within 1m of height after each dried for an hour. | Medium7 | Shortest pathGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chemicals MonitoringVictor admits the maximum-priority subset of streams that one shared output unit can report in stack order. | Medium7 | Dynamic programmingStack+2 | No attempts yet | 4s | 256 MB | Judgeable |
| Conditional StatementsGiven one-variable if lines that switch on numbered lights, delete as many lines as possible without changing which lights turn on for any input values. | Medium7 | IntervalsHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DiamondsArthas opens boxes outward from his starting keys to collect every diamond with the fewest openings. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Array GameThe player shifts all numbers left or right each turn to maximize the total signed value collected when numbers land on fixed plus and minus cells. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| Flight Boarding OptimizationYou split the rows into k contiguous zones and order their boarding phases, keeping queue order inside each zone, to minimize total boarding difficulty. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 2s | 256 MB | Judgeable |
| International EventFind the minimum distance for a robot starting and ending at A to move every flag along a line from its old pole to a pole requesting that nation. | Medium7 | GreedyPrefix sum+1 | No attempts yet | 5s | 128 MB | Judgeable |
| NP-hardFind the shortest route that visits each of up to 1500 cities once when every city keeps all lower-numbered cities on one side of it. | Medium7 | Dynamic programmingIntervals | No attempts yet | 2s | 256 MB | Judgeable |
| TorrentHwiwon collects all n pieces from seeds with fixed online windows at one piece per second and reports the earliest time the file is complete, or -1. | Medium7 | GraphBinary search+1 | No attempts yet | 2s | 128 MB | Judgeable |
| It Can Be ArrangedFind the fewest rooms for daily courses that each need several parallel rooms, where a room can run course j after course i only if cleaning ends first. | Medium7 | GraphIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Infix to PrefixGiven a prefix expression with spaces and parentheses removed, compute the smallest and largest values over all valid parses. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 5s | 128 MB | Judgeable |
| DemonstrationsChoose up to two intervals to cancel so the total covered length of the remaining intervals shrinks as much as possible. | Medium7 | IntervalsSorting | No attempts yet | 3s | 128 MB | Judgeable |
| The HeroFind the shortest sailing time from island 1 to island n, waiting on islands to dodge trap intervals that forbid presence on active days. | Medium7 | Shortest pathIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| LaserChoose up to K rays from the origin to hit the most first-quadrant segments, with no segment hit by two rays. | Medium7 | Dynamic programmingGeometry+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Xiao Long BaoChoose the order to eat N dumplings in a row to maximize total flavor, with each eaten dumpling adding its bonus to uneaten dumplings within its reach. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| TeamsSplit the row into the most contiguous teams so each student's team size lies within their given range, and count those optimal splits. | Medium7 | Dynamic programmingSegment tree+1 | No attempts yet | 5s | 256 MB | Judgeable |
| Ring road bus routesPrint the numbers of the clockwise arcs on an N-stop ring that no other given arc fully covers, in increasing order. | Medium7 | IntervalsSorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Picture ValidatorDecide whether two robot-drawn line pictures cover the same point set up to translation. | Medium7 | GeometryIntervals+1 | No attempts yet | 1s | 256 MB | Judgeable |
| ShoppingA shopper starts at the entrance, visits each of N shops in a row under the given order constraints, and ends at the exit with the shortest total walk. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Strange AntennasCount grid cells covered by an odd number of diagonal triangular antenna signals. | Medium7 | GeometryPrefix sum+1 | No attempts yet | 5s | 256 MB | Judgeable |
| Generalized Roman NumeralsGiven a string of Roman letters, list every distinct value it can take under all parenthesizations of the subtract-when-smaller rule. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Two YachtsPick priced time intervals so no day is covered more than twice and the total price is maximal. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Alien InvadersDestroy each alien within its time window using bombs, where a bomb of power R kills all aliens present within distance R at cost R, for minimum total fuel. | Medium7 | Dynamic programmingDivide and conquer+2 | No attempts yet | 3s | 256 MB | Judgeable |
| The Safe SecretFor each ring rotation, replace each ? with +, - or * and parenthesize to get the min and max values, then join their digits in order. | Medium7 | Dynamic programmingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| AntennasPlace carrier-specific or shared antennas on a line so each house interval meets a matching coverage interval at minimum cost. | Medium7 | Dynamic programmingSorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Cutting the Cake 2JOI chooses the first slice of a round cake, then both sides take exposed ends in turn against an opponent who always takes the larger end. | Medium7 | Game theoryDynamic programming+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Trapped in the HaybalesMeasure the total length of starting positions between sorted bales from which repeated run-up breaks can reach neither the leftmost nor the rightmost bale. | Medium7 | Dynamic programmingSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| MatChoose a set of top-anchored and bottom-anchored rectangles with disjoint interiors that maximizes total profit. | Medium7 | Dynamic programmingIntervals+1 | No attempts yet | 1s | 512 MB | Judgeable |