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 |
|---|---|---|---|---|---|---|
| Fence PaintingCompute the total painted length covered by two given intervals on a number line. | Easy1 | IntervalsMath | No attempts yet | 2s | 512 MB | Judgeable |
| AAAAHH! Overbooked!Given N event time ranges in hh:mm-hh:mm format, check whether any two events overlap in time. | Easy2 | IntervalsSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Rectangle intersectionCompute the area shared by all n axis-aligned rectangles, or 0 when they do not all overlap. | Easy2 | GeometryIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| Mirror TenderDecide for each test case whether one workshop's width and height ranges contain every other workshop's ranges. | Easy2 | Intervals | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Easy2 | MathIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Egg Drop LogFrom the logged safe and broken drops, compute the lowest floor that could break and the highest floor that could stay safe. | Easy2 | IntervalsImplementation | No attempts yet | 2s | 256 MB | Judgeable |
| GBus Count (Small)Count, for each queried city, how many of the given inclusive ranges cover it. | Easy2 | Brute forceIntervals | No attempts yet | 5s | 512 MB | Judgeable |
| GBus Count (Large)Count, for each queried city, how many of the given inclusive intervals cover it. | Easy2 | Brute forceIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Easy3 | GreedySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Repairing a Mud RoadGiven non-overlapping puddle intervals and fixed-length planks, find the minimum number of planks needed to cover all puddles. | Easy3 | GreedyIntervals | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Easy3 | GreedySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Drawing LinesGiven N line segments on a number line, compute the total length covered by at least one segment, merging overlaps. | Easy3 | IntervalsSorting+1 | No attempts yet | 1s | 192 MB | Judgeable |
| 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. | Easy3 | SortingSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| I-SoarGiven building intervals along a highway, find the total length of the highway not covered by any building. | Easy3 | IntervalsSorting | No attempts yet | 1s | 128 MB | Judgeable |
| 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.For | Easy3 | GeometryIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AnimalsGiven N active time intervals, find whether they share a common moment and, if so, the longest interval when all animals are active. | Easy3 | IntervalsImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| IntervalsGiven n closed intervals, merge all overlapping or touching ones and print the resulting disjoint intervals in ascending order. | Easy3 | SortingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IntervalsCount the integers covered by at least one of N closed intervals in each test set. | Easy3 | IntervalsSorting | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Easy3 | SortingIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| CompoCount the pairs of contests whose inclusive time ranges overlap in each test case. | Easy3 | SortingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Server Capacity PlanGiven sorted request times, find the smallest server count so no server exceeds k concurrent 1000ms jobs. | Easy3 | Sliding windowIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| County Fair EventsGiven N intervals, find the maximum number of non-overlapping intervals John can attend. | Easy3 | GreedySorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| LifeguardsGiven N shifts, remove exactly one so that the total time covered by the remaining shifts is maximized. | Easy3 | IntervalsBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Easy3 | GreedyIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Advertising on the FenceGiven n intervals over boards 1 to m, decide whether their union covers every board from 1 to m. | Easy3 | IntervalsSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Lecture RoomsGiven N lecture intervals, compute the minimum number of rooms needed so no room hosts overlapping lectures, treating touching endpoints as non-overlapping. | Medium4 | GreedySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | IntervalsSorting+2 | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Medium4 | IntervalsSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | Dynamic programmingIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | IntervalsSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium4 | SortingImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Open IntervalsGiven up to 50 open intervals per test case, pick the largest subset where no two intervals overlap, counting touching endpoints as compatible. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Selfish GrazingGiven N intervals, find the maximum number of intervals that can be chosen so that no two of them overlap. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| InternetGiven measurements with connection states, where the first and last show a connection, find the longest possible time the connection could have been down. | Medium4 | GreedyImplementation+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| 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. | Medium4 | Brute forceMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Lucky LightCount the lighted regions on the x-axis that lie outside the shadows a point light casts from the given segments. | Medium4 | GeometryIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hotel ReservationsFind the fewest rooms that fit all reservations when a room freed at checkout needs C more minutes of cleaning. | Medium4 | IntervalsSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Handing Out BooksAssign each applicant at most one distinct book numbered within their requested interval to maximize the number of satisfied applicants. | Medium4 | GreedyIntervals+1 | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Medium4 | IntervalsImplementation | No attempts yet | 8s | 512 MB | Judgeable |
| Palindrome?Answer up to a million queries asking whether a given range of the number sequence is a palindrome. | Medium4 | Dynamic programmingIntervals | No attempts yet | 0.5s | 256 MB | Judgeable |
| Classroom assignmentGiven N class time intervals, find the smallest number of rooms so overlapping classes never share a room. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Serves Me RightReplay logins, logouts, restarts, and session timeouts to count distinct users and the highest number logged in at once. | Medium4 | SimulationHash map+1 | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Medium4 | Segment treeIntervals | No attempts yet | 2s | 64 MB | Judgeable |
| Painting a fence (small)From up to 10 offers, choose the fewest that cover sections 1 to 10000 using at most 3 distinct colors. | Medium4 | Brute forceIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium4 | GreedySorting+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium4 | ArraySorting+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Hidden PalindromeGiven a word of at most 40 lowercase letters, find the longest palindromic subsequence obtainable by deleting letters from the front and back. | Medium4 | Dynamic programmingString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Medium4 | Brute forceArray+2 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium4 | ArrayImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Coloring IntervalsGiven n closed intervals with distinct endpoints, find the minimum number of colors so that overlapping intervals get different colors. | Medium4 | SortingIntervals+2 | No attempts yet | 3s | 512 MB | Judgeable |
| 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. | Medium4 | ArraySimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Medium4 | IntervalsSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Drawing LinesGiven N segments on a number line, find the total length of their union, counting overlaps once and printing it as an integer. | Medium4 | SortingIntervals+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium4 | SimulationSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Overflowing FandomGiven N intervals during which fans are at school, find the minimum length of a single visit window that meets every interval. | Medium4 | IntervalsGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium4 | IntervalsImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| 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. | Medium5 | Segment treeIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingIntervals | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium5 | GreedyIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Concert Rest ScheduleSchedule N members' fixed-length rest intervals within a T-minute concert so that at most two intervals overlap at any moment. | Medium5 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedyIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedyGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Emma Loves PartiesGiven parties as hourly intervals, find the most Emma can attend if she stays at least 30 minutes at each one. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GeometryIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Extent of the ProblemSimulate RADDD's two-step defragmentation passes over disk blocks and output the final extent layout of every file. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | IntervalsSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SunscreenEach cow accepts an SPF interval, each bottle has an SPF value and capacity; assign bottles to maximize the number of cows covered. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GreedyIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AnimalsGiven N daily active intervals, some crossing midnight, find whether all overlap at some moment and output the longest common sub-interval. | Medium5 | IntervalsImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| 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. | Medium5 | GeometryBinary search+2 | No attempts yet | 2s | 128 MB | Judgeable |
| 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. | Medium5 | GreedySorting+2 | No attempts yet | 2s | 256 MB | Judgeable |
| 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. | Medium5 | IntervalsSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BrothersChoose the largest set of families whose position spans never overlap so each kept family stands together. | Medium5 | GreedyIntervals+1 | No attempts yet | 1s | 512 MB | Judgeable |
| MeteorThe task counts the largest number of meteors strictly inside a fixed rectangle at one moment as each meteor moves along a straight path. | Medium5 | IntervalsSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | Two pointersHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | MathIntervals | No attempts yet | 1s | 128 MB | Judgeable |
| Cut the ListSplit the list into K consecutive pieces to minimize the sum of each piece's max minus min. | Medium5 | Dynamic programmingIntervals | No attempts yet | 2s | 128 MB | Judgeable |
| Recording the MoolympicsSelect the largest set of programs that two tuners can record when one tuner cannot record overlapping programs. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingIntervals | No attempts yet | 5s | 256 MB | Judgeable |
| Learning by ExampleCount how many integer weights from A to B the nearest-neighbor classifier labels as spotted from N labeled training weights. | Medium5 | SortingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| StampedeCount how many moving segments are ever the closest to the origin while crossing the positive y-axis. | Medium5 | IntervalsSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| TV WarPick non-overlapping weekly TV programs to maximize the total preference score. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Mobile GamingTwo rectangles move at constant speed from time 0 to 1; report the first moment they touch or overlap, or report no collision. | Medium5 | GeometryIntervals+1 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium5 | GreedyIntervals | No attempts yet | 5s | 512 MB | Judgeable |
| Total File CountGiven printed pairs of truncated percent and files done, find the unique total file count that fits all lines or report ambiguity. | Medium5 | MathIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Fairland (Small)Marie keeps the largest manager-closed team containing herself whose salaries span at most D. | Medium5 | TreeDFS+2 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium5 | SimulationIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium5 | Brute forceIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium5 | SimulationIntervals | No attempts yet | 5s | 512 MB | Judgeable |
| 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. | Medium5 | IntervalsImplementation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| String TheoryGiven alternating runs of quote characters, find the largest k for which the whole string is a k-quotation. | Medium5 | Dynamic programmingString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| FocusGiven N closed intervals, find the minimum number of points needed so that every interval contains at least one chosen point. | Medium5 | GreedyIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Medium5 | Dynamic programmingIntervals | No attempts yet | 8s | 512 MB | Judgeable |
| AssignmentsGiven deadlines and scores for N assignments, pick a subset schedulable within their deadlines to maximize total score. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 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. | Medium5 | IntervalsSorting+1 | No attempts yet | 5s | 512 MB | Judgeable |