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 |
|---|---|---|---|---|---|---|
| InspectorGiven statements of the form 'at time t, programmer j was present along with i others', find the largest prefix of statements that can all hold at once. | Hard8 | IntervalsBrute force+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Painting the WallGiven n axis-aligned rectangles, find the total area of the plane covered by at least n-1 of them. | Hard8 | SortingSegment tree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TermitesTwo termites alternately eat planks adjacent to already-eaten ones, each maximizing her total; report the wood each ends up with under optimal play. | Hard8 | GreedyGame theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| TetrisEach block is a horizontal strip 1 unit tall; given its length and left offset, choose the drop order that minimizes the final stack height. Output that minimum. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Spy SatellitesGiven a terrain polyline with some marked points, place satellites on the line y=H so their visibility segments cover all marked points, minimizing the count. | Hard8 | GeometryGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Matryoshka DollsReassemble a row of dolls into complete 1 to m sets using adjacent merges while minimizing the number of doll openings. | Hard8 | Dynamic programmingIntervals | No attempts yet | 5s | 128 MB | Judgeable |
| Contour MapGiven up to 20000 non-crossing convex orthogonal polygons, compute the maximum nesting depth where the outermost level is 1. | Hard8 | GeometrySorting+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Block CompactionRepeatedly drop axis-aligned rectangles down and then left until none moves, and report the width and height of the final bounding box. | Hard8 | SimulationGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| KingdomRoads merge cities into connected states over time, and each query asks how many states a horizontal line meets and how many cities those states contain. | Hard8 | Union-findSegment tree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| StainsTaeyeon covers integer points off the x-axis with diamonds centered on the x-axis and minimizes the sum of their areas. | Hard8 | Dynamic programmingGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Rotate and RewriteDecide whether two rotatable integer sequences can be reduced to a common sequence by substring rewrite rules and report the greatest such length. | Hard8 | Dynamic programmingString matching+1 | No attempts yet | 15s | 128 MB | Judgeable |
| RingworldGiven n circular arcs on a ring of m cities, decide whether each arc can take a distinct city inside it. | Hard8 | GreedyIntervals+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Janeway's JourneyFind the single straight line that hits the greatest number of disjoint circular asteroids in the plane. | Hard8 | GeometrySorting+1 | No attempts yet | 40s | 128 MB | Judgeable |
| History classFind the event order that respects disjoint time order and minimizes the largest position gap between overlapping intervals. | Hard8 | IntervalsTopological sort+2 | No attempts yet | 10s | 128 MB | Judgeable |
| Cleaning the HallwayGiven up to 500 outlets, each cleaning the ring swept by a small disk around a circle, compute the area of their union rounded to two decimals. | Hard8 | GeometryMath+1 | No attempts yet | 5s | 128 MB | Judgeable |
| TV TransmittersSome rooftops hold transmitters, buildings block their straight rays, and the total length of ground that sees one transmitter is printed as a reduced fraction. | Hard8 | GeometryIntervals+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rent-A-PixelCompute the smallest row- and column-convex block set containing the given blocks and print its outline corners clockwise. | Hard8 | GeometryIntervals+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Tree LightingA point light shines a bounded wedge upward through absorbing and mirrored segments, and you report the lit percentage of a horizontal house front. | Hard8 | GeometrySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| RNAReport the longest contiguous block shared by both RNA strings whose parenthesis marks balance. | Hard8 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BridgesTowns on two banks link east on the north side and west on the south side while bridges are added and roads close and queries ask if one town reaches another. | Hard8 | GraphIntervals+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Line SweepFind the tallest vertical broom that still reaches every empty cell by sliding sideways, then the fewest sideways sweeps that clean them all. | Hard8 | GreedyIntervals+2 | No attempts yet | 10s | 256 MB | Judgeable |
| Truck EncountersCount how many times each queried pair of trucks, moving at equal speed along zigzag city routes, occupy the same position. | Hard8 | IntervalsSorting+1 | No attempts yet | 3s | 64 MB | Judgeable |
| The j-th NumberAfter copying each insert value into every array of its interval, each query asks for the j-th smallest value collected from an interval of arrays. | Hard8 | Binary searchSegment tree+2 | No attempts yet | 10s | 512 MB | Judgeable |
| HackerChoose a start on a valued ring and spread to neighboring computers each turn to maximize hacked value against an optimal blocker. | Hard8 | Game theoryDynamic programming+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Forming TeamsFor each planned day, decide whether students with accepted size ranges can fill all requested teams of the given sizes. | Hard8 | GreedyIntervals+2 | No attempts yet | 4s | 512 MB | Judgeable |
| Train of ThreesYou repeatedly merge adjacent matching pairs in an array of 1s, 2s and numbers of the form 3 times a power of two to form the largest tile possible. | Hard8 | Dynamic programmingIntervals | No attempts yet | 5s | 256 MB | Judgeable |
| Visitors' TrainCompute the total length of a straight track segment from which the main rectangle stays fully visible behind other rectangles. | Hard8 | GeometryIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Party joke setsCount distinct joke-type sets from root-connected guest groups with unique values where each subtree below a guest forms consecutive numbers. | Hard8 | Dynamic programmingTree+1 | No attempts yet | 1s | 32 MB | Judgeable |
| Cow ConfinementEach cow moves only down or right across a large grid and cannot cross rectangular fences, and the task asks how many flowers each cow can reach. | Hard8 | Segment treeSorting+1 | No attempts yet | 10s | 512 MB | Judgeable |
| Runaway QuailStarting at zero on a line, catch every quail that flees outward at a speed below yours in the smallest possible total time. | Hard8 | Dynamic programmingMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Hiking DeerChoose speeds, including full stops, for one clockwise loop of a circular trail to minimize meetings with hikers who walk at constant speeds. | Hard8 | MathSorting+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Hiking Deer (Large)Plan a variable-speed loop around a circular trail to cross paths with as few constant-speed hikers as possible. | Hard8 | GreedyIntervals+1 | No attempts yet | 5s | 512 MB | Judgeable |
| The Great Wall (Large)Count how many moving interval attacks pierce a wall that rises after each success to the strength that would have stopped it. | Hard8 | Segment treeIntervals+1 | No attempts yet | 15s | 512 MB | Judgeable |
| Painting a Fence (Large)Pick the fewest offers from N interval-and-color proposals so every one of 10000 fence sections is covered using at most 3 distinct colors. | Hard8 | IntervalsGreedy+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Dynamic memory allocationSimulate a memory allocator over n bytes: allocate the leftmost run of l free bytes, or free a range and count how many bytes were actually freed. | Hard8 | IntervalsSegment tree+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Wall RepairA robot on a line must visit every point; each point's repair cost grows linearly with the time it waits, so find the visiting order of minimum total cost. | Hard8 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Meteor ShowerCount the convex polygons that are completely hidden from the origin by other polygons, since every ray stops at the first one it hits. | Hard8 | GeometrySorting+1 | No attempts yet | 1s | 512 MB | Judgeable |
| IntegralGiven f at a set of integer points, extend it to a monotone piecewise linear function so the integral from 0 to n equals y. | Hard8 | Intervals | No attempts yet | 2s | 512 MB | Judgeable |
| Krypton StadiumsGiven n intervals where interval i contains point i, classify the layout as Great, Acceptable, or Bad based on whether pairs of cities are co-hosted by a nesting or shared stadium. | Hard8 | IntervalsGreedy+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Camera ControlMembers move along timed polygonal routes around a fixed camera, and you may switch followers only when two members lie on the same ray; maximize total time filming a singing member. | Hard8 | GeometryDynamic programming+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Demilitarized ZoneFor each protected point, count how many starting mines eventually trigger a blast covering it, given chain reactions over intervals. | Hard8 | IntervalsSorting+2 | No attempts yet | 3s | 256 MB | Judgeable |
| Dominoes (Large)Find the fewest pushes (each a domino plus a direction) needed to topple every domino through chain reactions. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Map LabelingPlace disjoint unit-height labels on a line above given points and count the minimum number of connectors that cannot run straight down to their own label. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Shooting GalleryA row of ducks, each with a species; a good round hits two ducks of the same species and keeps only the ducks strictly between them, and rounds continue while same-species pairs remain. Find the longest possible run of good rounds. | Hard8 | Dynamic programmingArray+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Starting a Scenic Railroad ServiceFor n travel segments, compute the minimum seats needed under arbitrary online seat choices and under optimal offline assignment. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Lifeguards (Platinum)Fire exactly K of N lifeguard shifts to maximize the total time covered by at least one remaining shift. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Grievous Loss of DataGiven the clash graph of N interval lectures, find the minimum number of halls, which equals the chromatic number guaranteed realizable by intervals. | Hard8 | GraphIntervals+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Shooter IslandOn a 50 by 100000 grid, rectangles flood when hit, and after each query decide whether a radius-0.31416 boat can sail between two given squares on the remaining water. | Hard8 | Union-findIntervals+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Overflowing PopularityGiven M guests with arrival and departure times, choose when to insert up to K extra friends so that the count of ordinary attendees stays below T as long as possible. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Running RoutesGiven chords of a convex n-gon, find the largest set of chords no two of which share any common point, including endpoints. | Hard8 | Dynamic programmingIntervals+2 | No attempts yet | 12s | 1024 MB | Judgeable |
| Sequence and Queries 31Maintain a 0/1 sequence under range reversals, and answer queries for the longest run of 1s inside a given range. | Hard8 | Segment treeIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Strange MachineCount the distinct pairs (x, y) produced by the map t -> (((t + floor(t/B)) mod A), t mod B) over n disjoint time intervals. | Hard8 | MathNumber theory+2 | No attempts yet | 4s | 512 MB | Judgeable |
| NamuhsGiven N unknown planet potentials, find the unique contiguous segment with the maximum sum using only queries that compare the sums of two segments. | Hard8 | Divide and conquerBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| LibraryGiven a hidden permutation of N books, query the oracle with a set of book numbers and receive the minimum number of contiguous-block removals needed to extract exactly those books, then recover the order. | Hard8 | IntervalsMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Watch LaterGiven a string of video types, find the minimum number of manual clicks needed to watch everything, where playback auto-advances to the next video only if it has the same type. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Glow, Pixel, Glow!Given horizontal and vertical pulses crossing a grid of wires, count the pixels where current passes through both intersecting wires at the same time. | Hard8 | SortingImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| True/False WorksheetCount binary strings of length n that satisfy range hints, where each hint says a range is all equal or not all equal, modulo 1e9+7. | Hard8 | Dynamic programmingPrefix sum+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Collecting Stamps 3On a circular lake, N stamps sit at given positions with individual collection deadlines; find the maximum number of stamps JOI-kun can collect starting from position 0. | Hard8 | Dynamic programmingIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Social DistancingPlace N cows on distinct integer grass points across M disjoint intervals on a line so that the minimum pairwise distance D is as large as possible, and output the largest achievable D. | Hard8 | Binary searchGreedy+2 | No attempts yet | 1s | 512 MB | Judgeable |
| New Year and ConferenceGiven n lectures, each with one time interval at venue a and another at venue b, decide whether every subset that is conflict-free at one venue is also conflict-free at the other. | Hard8 | IntervalsSorting+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Bag of BagsProcess bags one by one; keep a bag unless its equality class merges two classes that were already equal, and report the decision for each. | Hard8 | IntervalsUnion-find+2 | No attempts yet | 2s | 256 MB | Judgeable |
| SchedulingDecide whether n preemptible tasks with release times, deadlines, and processing times can be scheduled on m identical processors within their windows. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| ScheduleAssign interval tasks to machines so no two overlapping tasks share a machine; minimize the number of machines, then the total working time (earliest start to latest finish) across those machines. | Hard8 | IntervalsGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Saddle PointCount the n by m matrices with entries in 1..k that contain at least one position that is a strict maximum of both its row and its column, modulo 1e9+7. | Hard8 | CombinatoricsDynamic programming+2 | No attempts yet | 1s | 512 MB | Judgeable |
| A Game with GrundyFor each i from 0 to N, count integer x positions with L <= x <= R that lie strictly inside at most i of N triangular visibility wedges. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Shushpanchiks and the CinemaGiven an n by n grid with m blocked seats, choose k consecutive free seats in one row minimizing the sum of Manhattan distances to a target seat. | Hard8 | MathIntervals+2 | No attempts yet | 2s | 512 MB | Judgeable |
| BusSimulate bus boarding with passengers sitting in the closest free seat or standing over an occupied one, and choose Anton's seat minimizing the total time someone stands over him. | Hard8 | SimulationGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Robot ArmGiven a rectilinear factory polygon and five candidate fixed points, decide for each whether an L-shaped two-segment robot arm confined to the polygon can reach every interior point. | Hard9 | GeometryIntervals+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Museum GuardsAssign each guard repeating daily intervals on half-hour boundaries within their availability and minute limits so the minimum number of guards on duty is maximized. | Hard9 | Binary searchGreedy+2 | No attempts yet | 5s | 128 MB | Judgeable |
| TeleportersPlace up to M new teleporters between given endpoints so the forced eastward walk triggers as many teleports as possible. | Hard9 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Synnerg LifeformGiven rewriting rules that merge adjacent synnergs with multiplicative lifetimes, find all maximum-lifetime synnergs obtainable by fully unifying some contiguous block of each input sequence. | Hard9 | Dynamic programmingIntervals+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SetsGiven n arithmetic-progression sets of multiples of d_i, count elements in their union that share no prime factor with m. | Hard9 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Land TaxChoose a non-empty contiguous row and column range that maximizes combined row and column payments weighted by heights and widths. | Hard9 | Divide and conquerGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Thirsty AntsAnts on a line walk at unit speed toward the nearest fallen dew drop, and the task asks for every ant's position when the last drop is drunk. | Hard9 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fence WatchPlace the fewest sensors on a convex polygon boundary so every boundary point forms an angle from alpha to 360 degrees minus alpha with some sensor pair. | Hard9 | GeometryGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Chain & Co.Decide whether axis-aligned square links split into two nonempty groups with every cross pair linked. | Hard9 | GeometryGraph+1 | No attempts yet | 10s | 128 MB | Judgeable |
| Radio WatchtowersKeep K of N towers on a line and raise their radio powers so each pair of kept towers can talk, minimizing raise cost minus sale income. | Hard9 | GreedySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Rotating Cutter BitsThe program counts interior lattice points of a polygonal workpiece that survive one full rotation against a second rotating polygonal cutter. | Hard9 | GeometrySimulation+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Solve this one tooGiven an N x L matrix, find windows of 3N columns split into matrices A, B, C with A*B=C; pick disjoint windows to maximize total colored cells. | Hard9 | MatrixDynamic programming+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Koala GameDetermine properties of a hidden permutation by bidding stones in a game where Koala optimally maximizes the sum of values she wins, using as few rounds as possible. | Hard9 | Game theoryGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Lexicographically Smallest Sign SequenceFill a sign sequence of -1 and 1 with some fixed entries so that every range [Ai,Bi] has sum at least Ci, and output the lexicographically smallest valid sequence or Impossible. | Hard9 | GreedyPrefix sum+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Monitoring Ski PathsA DAG has at most one outgoing edge per junction and unique landing points; pick the fewest junctions met by all m registered s-to-t to-basement paths. | Hard9 | GraphGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Removing Magical TilesGiven trapezoid tiles above the x-axis, find the minimum number of groups where each group is a set of tiles that pairwise overlap. | Hard9 | GreedyGeometry+2 | No attempts yet | 2s | 512 MB | Judgeable |
| mex and QueriesMaintain a set of natural numbers under range add, range remove, and range toggle queries, then output the mex after each of up to 100000 queries with values up to 1e18. | Hard9 | Segment treeIntervals+1 | No attempts yet | 2s | 512 MB | Judgeable |
| HotelMaintain an array under point height updates; after each update answer queries for the longest subsegment inside [l, r] that contains no strict interior valley. | Hard9 | Segment treeArray+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ExploreAn interactive graph-reconstruction task: with limited modify, query, report, and check calls, determine every edge of an unknown undirected graph. | Hard9 | GraphDivide and conquer+2 | No attempts yet | 1s | 512 MB | Judgeable |