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
TitleLevelTopicsSolvedTime limitMemory limitJudge
Fence PaintingCompute the total painted length covered by two given intervals on a number line.Easy1IntervalsMathNo attempts yet2s512 MBJudgeable
AAAAHH! Overbooked!Given N event time ranges in hh:mm-hh:mm format, check whether any two events overlap in time.Easy2IntervalsSortingNo attempts yet1s128 MBJudgeable
Rectangle intersectionCompute the area shared by all n axis-aligned rectangles, or 0 when they do not all overlap.Easy2GeometryIntervalsNo attempts yet2s512 MBJudgeable
Mirror TenderDecide for each test case whether one workshop's width and height ranges contain every other workshop's ranges.Easy2IntervalsNo attempts yet1s256 MBJudgeable
Best guess in the random gamePick the number from 1 to N whose interval of radius K covers the most hidden values and report its coverage count.Easy2MathIntervalsNo attempts yet1s256 MBJudgeable
Egg Drop LogFrom the logged safe and broken drops, compute the lowest floor that could break and the highest floor that could stay safe.Easy2IntervalsImplementationNo attempts yet2s256 MBJudgeable
GBus Count (Small)Count, for each queried city, how many of the given inclusive ranges cover it.Easy2Brute forceIntervalsNo attempts yet5s512 MBJudgeable
GBus Count (Large)Count, for each queried city, how many of the given inclusive intervals cover it.Easy2Brute forceIntervals+1No attempts yet5s512 MBJudgeable
Repairing Pipe LeaksGiven leak positions and a fixed tape length, compute the minimum number of length-L tapes needed so each leak is covered with at least 0.5 margin on both sides.Easy3GreedySorting+1No attempts yet2s128 MBJudgeable
Repairing a Mud RoadGiven non-overlapping puddle intervals and fixed-length planks, find the minimum number of planks needed to cover all puddles.Easy3GreedyIntervalsNo attempts yet2s128 MBJudgeable
Meeting Room SchedulingGiven N meetings with start and end times, select the maximum number of non-overlapping meetings using a classic greedy interval scheduling approach.Easy3GreedySorting+1No attempts yet2s128 MBJudgeable
Drawing LinesGiven N line segments on a number line, compute the total length covered by at least one segment, merging overlaps.Easy3IntervalsSorting+1No attempts yet1s192 MBJudgeable
Mowing the LawnDetermine if sorted mower path coordinates with a given strip width fully cover a 75x100 rectangle in both directions, across multiple test cases until a terminator line.Easy3SortingSimulation+1No attempts yet1s128 MBJudgeable
I-SoarGiven building intervals along a highway, find the total length of the highway not covered by any building.Easy3IntervalsSortingNo attempts yet1s128 MBJudgeable
SkylineWe have N trapezoidal buildings listed from nearest to farthest. For each building, we must compute the fraction of its area that remains visible, i.e., the part of the trapezoid not hidden by any closer building. The presence of overlapping sloped roofs makes the computation nontrivial: for a given building we need to determine, for each horizontal coordinate, the maximum roof height among all closer buildings. Then the visible area is the integral, over the building’s own range [x1, x2], of the positive part of the difference between the building's top edge (roof) and that maximum height.ForEasy3GeometryIntervals+2No attempts yet1s128 MBJudgeable
AnimalsGiven N active time intervals, find whether they share a common moment and, if so, the longest interval when all animals are active.Easy3IntervalsImplementation+2No attempts yet1s1024 MBJudgeable
IntervalsGiven n closed intervals, merge all overlapping or touching ones and print the resulting disjoint intervals in ascending order.Easy3SortingIntervals+2No attempts yet1s128 MBJudgeable
IntervalsCount the integers covered by at least one of N closed intervals in each test set.Easy3IntervalsSortingNo attempts yet2s128 MBJudgeable
Goldilocks and the N CowsChoose an integer barn temperature that maximizes total milk when each cow yields X if cold, Y if inside its range, and Z if hot.Easy3SortingIntervalsNo attempts yet1s128 MBJudgeable
CompoCount the pairs of contests whose inclusive time ranges overlap in each test case.Easy3SortingIntervalsNo attempts yet1s256 MBJudgeable
Server Capacity PlanGiven sorted request times, find the smallest server count so no server exceeds k concurrent 1000ms jobs.Easy3Sliding windowIntervalsNo attempts yet1s256 MBJudgeable
County Fair EventsGiven N intervals, find the maximum number of non-overlapping intervals John can attend.Easy3GreedySorting+1No attempts yet2s512 MBJudgeable
LifeguardsGiven N shifts, remove exactly one so that the total time covered by the remaining shifts is maximized.Easy3IntervalsBrute force+1No attempts yet2s512 MBJudgeable
Grenade in the Lake!!Given people on a line with throw ranges, decide whether the grenade can travel from the first person to the last.Easy3GreedyIntervals+1No attempts yet2s512 MBJudgeable
Advertising on the FenceGiven n intervals over boards 1 to m, decide whether their union covers every board from 1 to m.Easy3IntervalsSorting+1No attempts yet2s512 MBJudgeable
Lecture RoomsGiven N lecture intervals, compute the minimum number of rooms needed so no room hosts overlapping lectures, treating touching endpoints as non-overlapping.Medium4GreedySorting+1No attempts yet2s128 MBJudgeable
Overlapping SegmentsGiven N line segments on a number line, compute the maximum number of segments that overlap at any single point, not counting endpoint-only contacts.Medium4IntervalsSorting+2No attempts yet2s256 MBJudgeable
Amusement ParkGiven ride schedules with 10-minute buffers before and after each, find the longest free interval within 10:00-22:00 where no ride's blocked window overlaps.Medium4IntervalsSorting+1No attempts yet1s128 MBJudgeable
Maximum Number of Noncrossing Circle ChordsGiven up to 50 chords on 100 circle points with distinct endpoints, find the maximum subset of chords with no two crossing.Medium4Dynamic programmingIntervals+1No attempts yet1s128 MBJudgeable
Happy Phone CallFor each query time window, count how many given phone-call intervals overlap it by at least one second, across multiple test cases.Medium4IntervalsSorting+1No attempts yet2s128 MBJudgeable
The History of the Sith RulersGiven up to 50 rulers with the start and end months of each reign, report which rulers held power during each queried year, in order.Medium4SortingImplementation+2No attempts yet1s128 MBJudgeable
Open IntervalsGiven up to 50 open intervals per test case, pick the largest subset where no two intervals overlap, counting touching endpoints as compatible.Medium4GreedySorting+2No attempts yet1s128 MBJudgeable
Selfish GrazingGiven N intervals, find the maximum number of intervals that can be chosen so that no two of them overlap.Medium4GreedySorting+2No attempts yet1s128 MBJudgeable
Time ManagementGiven each chore's duration and deadline, find the latest start time that lets John finish all chores before their deadlines, or print -1.Medium4GreedySorting+2No attempts yet1s128 MBJudgeable
InternetGiven measurements with connection states, where the first and last show a connection, find the longest possible time the connection could have been down.Medium4GreedyImplementation+1No attempts yet1s1024 MBJudgeable
Internet Cafe FeeYou start playing at a given time for a given duration and pay the cheapest mix of hourly charges and nightly flat passes.Medium4Brute forceMath+1No attempts yet1s128 MBJudgeable
Lucky LightCount the lighted regions on the x-axis that lie outside the shadows a point light casts from the given segments.Medium4GeometryIntervals+1No attempts yet1s128 MBJudgeable
Hotel ReservationsFind the fewest rooms that fit all reservations when a room freed at checkout needs C more minutes of cleaning.Medium4IntervalsSorting+2No attempts yet2s128 MBJudgeable
Handing Out BooksAssign each applicant at most one distinct book numbered within their requested interval to maximize the number of satisfied applicants.Medium4GreedyIntervals+1No attempts yet2s256 MBJudgeable
Broken Audio SignalThe program finds the one integer that fills every x and makes odd positions valleys and even positions peaks, or reports ambiguous or none.Medium4IntervalsImplementationNo attempts yet8s512 MBJudgeable
Palindrome?Answer up to a million queries asking whether a given range of the number sequence is a palindrome.Medium4Dynamic programmingIntervalsNo attempts yet0.5s256 MBJudgeable
Classroom assignmentGiven N class time intervals, find the smallest number of rooms so overlapping classes never share a room.Medium4GreedySorting+2No attempts yet1s256 MBJudgeable
Serves Me RightReplay logins, logouts, restarts, and session timeouts to count distinct users and the highest number logged in at once.Medium4SimulationHash map+1No attempts yet2s256 MBJudgeable
TradingEach trader covers villages L to R with a price that rises by 1 per village, and each village reports the highest price ever asked there.Medium4Segment treeIntervalsNo attempts yet2s64 MBJudgeable
Painting a fence (small)From up to 10 offers, choose the fewest that cover sections 1 to 10000 using at most 3 distinct colors.Medium4Brute forceIntervals+1No attempts yet5s512 MBJudgeable
Train Timetable (Large)Given each train's departure and arrival times plus a turnaround time, find the minimum trainsets needed at stations A and B to run the timetable.Medium4GreedySorting+1No attempts yet5s512 MBJudgeable
Era NameGiven partial records mapping Western years to era names and regnal years, determine the era name and year for each query, or report Unknown when no record covers it.Medium4ArraySorting+2No attempts yet8s512 MBJudgeable
Hidden PalindromeGiven a word of at most 40 lowercase letters, find the longest palindromic subsequence obtainable by deleting letters from the front and back.Medium4Dynamic programmingString+2No attempts yet2s512 MBJudgeable
Stretch Rope (Small)N is at most 10, so enumerate subsets of bands and find the cheapest subset whose summed intervals contain L and whose total price is within M.Medium4Brute forceArray+2No attempts yet5s512 MBJudgeable
Why Did the Cow Cross the Road IIGiven a 52-character string where each of the 26 letters appears twice, count pairs of letters whose chord crossings force their paths to intersect.Medium4ArrayImplementation+2No attempts yet2s512 MBJudgeable
Street LightsGiven existing street lights that each cover K metres to both sides, find the minimum number of extra lights needed to light every metre from 1 to N.Medium4GreedySorting+2No attempts yet1s64 MBJudgeable
Coloring IntervalsGiven n closed intervals with distinct endpoints, find the minimum number of colors so that overlapping intervals get different colors.Medium4SortingIntervals+2No attempts yet3s512 MBJudgeable
WindowGiven N panes of size W by H, slide odd-indexed panes east and even-indexed panes west by given distances, then compute the uncovered window area.Medium4ArraySimulation+2No attempts yet2s512 MBJudgeable
Au au ua ui ya!!Given N segments [x, y] already sorted by x, compute the total length covered by their union on the number line.Medium4IntervalsSorting+2No attempts yet2s512 MBJudgeable
Drawing LinesGiven N segments on a number line, find the total length of their union, counting overlaps once and printing it as an integer.Medium4SortingIntervals+2No attempts yet1s256 MBJudgeable
The Bucket ListGiven N milking intervals, each needing a fixed number of buckets, find the smallest labels FJ's greedy allocation ends up using across all cows.Medium4SimulationSorting+2No attempts yet2s512 MBJudgeable
Overflowing FandomGiven N intervals during which fans are at school, find the minimum length of a single visit window that meets every interval.Medium4IntervalsGreedy+2No attempts yet1s256 MBJudgeable
Cooking WaterGiven N intervals of time Edward did not watch a pot, decide whether some single boil time is possible, meaning it lies inside every unwatched interval.Medium4IntervalsImplementation+1No attempts yet1s512 MBJudgeable
SwitchesGiven a switch array of size N, support range flips and range count-of-on queries over M operations, best solved with a segment tree with lazy propagation.Medium5Segment treeIntervals+1No attempts yet1s128 MBJudgeable
CheersGiven N people around a circle each drinking a cola brand, find the maximum number of non-crossing pairs connecting people with the same brand.Medium5Dynamic programmingIntervalsNo attempts yet2s128 MBJudgeable
Covering a SegmentGiven up to 100,000 segments on a line, find the minimum number needed to fully cover [0, M], or output 0 if impossible.Medium5GreedyIntervals+1No attempts yet2s128 MBJudgeable
Concert Rest ScheduleSchedule N members' fixed-length rest intervals within a T-minute concert so that at most two intervals overlap at any moment.Medium5GreedyIntervals+1No attempts yet1s128 MBJudgeable
Non-Intersecting CirclesGiven N circles centered on the x-axis, find the minimum number to remove so no two remaining circles overlap, essentially an interval scheduling problem.Medium5GreedyIntervals+1No attempts yet1s128 MBJudgeable
HighwayGiven villages near a segment highway, find the minimum number of points on the segment so every village lies within distance D of some chosen point.Medium5GreedyGeometry+1No attempts yet1s128 MBJudgeable
Emma Loves PartiesGiven parties as hourly intervals, find the most Emma can attend if she stays at least 30 minutes at each one.Medium5GreedySorting+1No attempts yet1s128 MBJudgeable
Thinking Inside the BoxFor each test case, report every stored Data Box that intersects, touches, or overlaps at least one Query Box, accounting for longitude wraparound.Medium5GeometryIntervals+1No attempts yet1s128 MBJudgeable
The Extent of the ProblemSimulate RADDD's two-step defragmentation passes over disk blocks and output the final extent layout of every file.Medium5SimulationImplementation+2No attempts yet1s128 MBJudgeable
Gift from the Goddess of ProgrammingEach log line records the entrance or exit of a visitor or the goddess (ID 000). Find the visitor who spends the most time at the altar while the goddess is present.Medium5SimulationSorting+2No attempts yet1s128 MBJudgeable
Analyzing Login/Logout RecordsGiven login and logout records on PCs, compute for each query how many minutes a student used at least one PC during a time interval.Medium5IntervalsSimulation+2No attempts yet1s128 MBJudgeable
The Perfect AlibiEach witness gives a suspect, a place, and a time interval; conflicting pairs are discarded, and we list suspects with no surviving witness covering the crime time.Medium5ImplementationSorting+2No attempts yet1s128 MBJudgeable
SunscreenEach cow accepts an SPF interval, each bottle has an SPF value and capacity; assign bottles to maximize the number of cows covered.Medium5GreedySorting+2No attempts yet1s128 MBJudgeable
Radar InstallationEach island on the sea side of a line must be covered by radars of reach d placed on the line, so find the minimum number of placements or report -1 if some island is unreachable.Medium5GreedyIntervals+2No attempts yet1s128 MBJudgeable
AnimalsGiven N daily active intervals, some crossing midnight, find whether all overlap at some moment and output the longest common sub-interval.Medium5IntervalsImplementation+2No attempts yet1s1024 MBJudgeable
GunmanEach window is a rectangle at a distinct depth; decide whether one straight ray fired from the X axis can pass through all of them.Medium5GeometryBinary search+2No attempts yet2s128 MBJudgeable
Olympic GamesGiven each event's date and start and end times in hhmm, find the maximum number of events a person can attend without overlap, moving freely between venues.Medium5GreedySorting+2No attempts yet2s256 MBJudgeable
Crime at Piccadilly CircusFor each integer moment in [p, k], count how many people's inclusive intervals cover it, and report the minimum and maximum counts.Medium5IntervalsSorting+2No attempts yet1s128 MBJudgeable
BrothersChoose the largest set of families whose position spans never overlap so each kept family stands together.Medium5GreedyIntervals+1No attempts yet1s512 MBJudgeable
MeteorThe task counts the largest number of meteors strictly inside a fixed rectangle at one moment as each meteor moves along a straight path.Medium5IntervalsSorting+1No attempts yet1s128 MBJudgeable
Call Me Back, Please!Read call records with start times and durations and list every pair of numbers with opposite-direction calls that fit in one 24-hour window.Medium5Two pointersHash map+2No attempts yet1s128 MBJudgeable
Ham and the man of the yearFind the smallest ham total up to 10^7 whose ratio shares added to eaten amounts rank people 1 to N from most to least.Medium5MathIntervalsNo attempts yet1s128 MBJudgeable
Cut the ListSplit the list into K consecutive pieces to minimize the sum of each piece's max minus min.Medium5Dynamic programmingIntervalsNo attempts yet2s128 MBJudgeable
Recording the MoolympicsSelect the largest set of programs that two tuners can record when one tuner cannot record overlapping programs.Medium5GreedySorting+1No attempts yet1s128 MBJudgeable
Chomsky Normal Form GrammarDecide whether a given string of up to 1000 lowercase letters belongs to the language generated from start symbol S by a CNF grammar.Medium5Dynamic programmingIntervalsNo attempts yet5s256 MBJudgeable
Learning by ExampleCount how many integer weights from A to B the nearest-neighbor classifier labels as spotted from N labeled training weights.Medium5SortingIntervalsNo attempts yet1s256 MBJudgeable
StampedeCount how many moving segments are ever the closest to the origin while crossing the positive y-axis.Medium5IntervalsSorting+1No attempts yet1s256 MBJudgeable
TV WarPick non-overlapping weekly TV programs to maximize the total preference score.Medium5Dynamic programmingSorting+2No attempts yet1s256 MBJudgeable
Mobile GamingTwo rectangles move at constant speed from time 0 to 1; report the first moment they touch or overlap, or report no collision.Medium5GeometryIntervals+1No attempts yet1s256 MBJudgeable
Virtual Rabbit (Small)Feed a pet at allowed times of day so no gap between feedings exceeds X seconds, using as few feedings as possible.Medium5GreedyIntervalsNo attempts yet5s512 MBJudgeable
Total File CountGiven printed pairs of truncated percent and files done, find the unique total file count that fits all lines or report ambiguity.Medium5MathIntervals+1No attempts yet5s512 MBJudgeable
Fairland (Small)Marie keeps the largest manager-closed team containing herself whose salaries span at most D.Medium5TreeDFS+2No attempts yet5s512 MBJudgeable
The Great Wall (Small)Count the interval attacks that breach a wall which rises to each successful attack's strength, judging attacks on the same day against the unchanged wall.Medium5SimulationIntervals+1No attempts yet5s512 MBJudgeable
Zombie Smash (Small)Plan a route from (0, 0) that smashes the most zombies, each catchable for 1000 ms after it appears, with 8-direction moves and a 750 ms smasher recharge.Medium5Brute forceIntervals+1No attempts yet5s512 MBJudgeable
Card Shuffle (Large)Find the card at position W after moving the given blocks of a numbered M-card deck to the top C times.Medium5SimulationIntervalsNo attempts yet5s512 MBJudgeable
What are Birds? (Small)Given labeled bird and non-bird points in 2D, decide for unlabeled animals whether they must be birds, cannot be birds, or are unknown.Medium5IntervalsImplementation+1No attempts yet5s512 MBJudgeable
String TheoryGiven alternating runs of quote characters, find the largest k for which the whole string is a k-quotation.Medium5Dynamic programmingString+1No attempts yet2s512 MBJudgeable
FocusGiven N closed intervals, find the minimum number of points needed so that every interval contains at least one chosen point.Medium5GreedyIntervals+2No attempts yet2s512 MBJudgeable
Sentence ReductionGiven tasks with weekday, start and end times, and point values, pick a non-overlapping set that maximizes total points, and report the per-day breakdown.Medium5Dynamic programmingSorting+2No attempts yet2s512 MBJudgeable
Gather on the ClockCards sit on a ring; repeatedly stack a card onto its clockwise neighbor for the value difference, and maximize the total score when one card remains.Medium5Dynamic programmingIntervalsNo attempts yet8s512 MBJudgeable
AssignmentsGiven deadlines and scores for N assignments, pick a subset schedulable within their deadlines to maximize total score.Medium5GreedySorting+2No attempts yet1s256 MBJudgeable
Watson and Intervals (Small)Generate N intervals from a recurrence, then remove exactly one interval so the number of integers covered by the rest is minimized.Medium5IntervalsSorting+1No attempts yet5s512 MBJudgeable