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 results2,741 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Caravan RobbersGiven nested-free intervals, place equal-length disjoint subintervals inside them and output the maximum common length as an exact fraction. | Hard8 | Binary searchGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Kingdom ReunionDecide whether three lists of points form simple polygons and whether the first two are disjoint with union equal to the third. | Hard8 | GeometryImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| KunaiNinjas on a huge grid throw kunai in four directions; kunai vanish when two arrive at the same point at the same instant, so count the squares any surviving kunai passes through. | Hard8 | GeometryHash map+2 | No attempts yet | 3s | 256 MB | Judgeable |
| SignalGiven n points with no three collinear and no four concyclic, average over all triples the number of points inside or on the circle through the triple. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Recovering the Common Ratio of a Geometric SequenceGiven a shuffled, partially deleted integer geometric sequence, find the common ratio with the largest absolute value (positive on ties), or 0 if none exists. | Hard8 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| New HorizonsGiven a spherical planet, a throne position and height, decide which object tops rise above Yertle's horizon and print their names sorted alphabetically. | Hard8 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Takeover WarsTwo firms alternate merging their own subsidiaries or absorbing a strictly smaller rival one; decide who wins the takeover war with optimal play. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Machine WorksBuy and resell at most one machine at a time over D days, each machine usable from its sale day, to maximize final cash. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Brownie Points IIGiven points in the plane, Stan picks a vertical line and Ollie a horizontal line through it; find Stan's guaranteed score and the distinct best Ollie scores. | Hard8 | SortingPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Advanced Causal Measurements (ACM)Given n observed events and m causes, place the m causes so all events are causally reachable and the earliest cause time is maximized. | Hard8 | Binary searchGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Brief GerrymanderChoose A avenue boundaries including 1 and 100 to maximize the number of vertical strips that contain at least one marked neighborhood, given fixed street boundaries. | Hard8 | Dynamic programmingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Intellectual PropertyGiven two code bases as raw strings, find the k longest maximal substrings of the JCN base that also occur in the TDP base, with exact positions and lengths. | Hard8 | String matchingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CatenymsFind the lexicographically smallest ordering of dictionary words where each word's last letter equals the next word's first letter, using every word once. | Hard8 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Classic Myth: Flatland SuperheroFor each swarm of points, compute the minimum area of a parallelogram that contains all of them, using the rotating calipers method on the convex hull. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Collateral CleanupGiven a triangulated rectangle, find the lexicographically smallest order to lower triangles straight down so no placed piece blocks a later one. | Hard8 | GeometryTopological sort+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Optimal Strategy for the ICPCGiven up to 15 problem solving times, schedule them on three parallel workers within 300 minutes to maximize solved count, then minimize total completion-time penalty, with lexicographically smallest order. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Doors and PenguinsGiven axis-parallel rectangles labeled Doors or Penguins, decide whether one straight line avoiding all rectangles can separate the two groups. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Line of SightGiven a house segment, a property-line segment, and horizontal obstruction segments, find the length of the longest continuous stretch of the property line from which the whole house is visible. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Sloppy SortGiven a possibly inconsistent comparison function as an n by n table, find the permutation of 0 to n-1 with the fewest inversions, breaking ties by the lexicographically smallest one. | Hard8 | Dynamic programmingBit manipulation+2 | No attempts yet | 3s | 128 MB | Judgeable |
| SoccerGiven a partial soccer schedule with at most 12 unplayed matches, find the best and worst final rank each team can still achieve. Ties share the same position. | Hard8 | Brute forceImplementation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Tighten Up!Given a polygonal string between two holes and a set of pins, compute the length of the taut chain that wraps around the pins when pulled tight. | Hard8 | GeometryGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Dr. Podboq, or: How We Became AsymmetricRead a binary tree of cells, define each cell's left-right similarity by shared subtree shapes up to child swaps, then reorder children by asymmetry and print the normalized tree. | Hard8 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Water TankSimulate water filling a 100 cm tank divided by partition boards of distinct heights, with faucets pouring into regions, and report the exact water level at given positions and times as integers or reduced fractions. | Hard8 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| StatisticiansGiven a grid of counts, take the median of the mean densities over all axis-aligned subrectangles whose area lies in [a,b]. | Hard8 | Prefix sumBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| DinnerGiven a complete graph on n vertices with edge years (default 2008), find the smallest year Y such that vertices split into two parts of size at most 2n/3, one with all edges before Y, the other with all edges at or after Y. | Hard8 | GraphSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Lecture ScreensGiven a simple polygon hall, a viewpoint, and directed screens, compute the total fraction of shared content visible across all screens after occlusion by the walls. | Hard8 | GeometryImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Circle of FriendsFor each queried node in an undirected graph, find the largest k-core containing it, then output the largest connected component of that core with its members sorted. | Hard8 | GraphImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Best TeamsGiven N players each with an age and distinct skill, and forbidden pairs that are adjacent in skill order, answer T queries each asking the maximum sum of at most K players with age at most A. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Prefix MediansGiven the prefix medians B of an unknown permutation of 1 to 2N-1, reconstruct the lexicographically smallest permutation that produces exactly those medians. | Hard8 | GreedyImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CipherFind the a x b subarray that occurs exactly k times (k >= 3) in an n x m character grid and list all its top-left positions in row-major order. | Hard8 | Hash mapString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Stairways of SaharnaSplit a sequence into k disjoint non-decreasing subsequences to maximize the total number of chosen elements, and output this maximum for every k up to the point where all n elements are used. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 0.2s | 128 MB | Judgeable |
| Hi! I'm Luffy! I'm the man who will become the Pirate King!Given island coordinates and left-of constraints per map, list every island that can be the viewpoint so all listed islands lie in a forward half-plane and constraints hold. | Hard8 | GeometrySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ClockFind the largest empty circle fully inside a rectangular wall that avoids up to 50 non-overlapping discs, using a generalized Voronoi diagram of points, segments, and circles. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pie DivisionCount the number of straight lines that split 2N labeled points (N of each of two colors, N even) so that each open half-plane holds N/2 points of each color, treating both sides as the same split. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 256 MB | Judgeable |
| RobintronGiven planets orbiting a star at constant angular speeds, find the minimum time for the Robintron to hop between gravity wells from the first planet to the last, rounding up to whole days. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| HiringChoose a real wage coefficient k and a subset of workers so that each hired worker's pay Q_i*k meets their minimum S_i and the total pay stays within budget W, maximizing the subset size. | Hard8 | SortingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FishGiven fish lengths and gem kinds, count how many distinct gem-count combinations a single fish can ever hold, modulo M, where a fish can eat another only if at least twice as long. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 3s | 128 MB | Judgeable |
| Toy AnimalsCount pairs of points on a 1D, 2D, or 3D integer grid whose Manhattan distance is at most D. | Hard8 | Divide and conquerSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Joining PointsGiven two sets of colored points in general position inside a square, output a non-crossing spanning tree for each color separately. | Hard8 | GeometryGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BirthdayChildren sit around a round table in order 1..n; reseat them into a given cyclic order while minimizing the largest distance anyone walks along the circle. | Hard8 | Binary searchSorting+2 | No attempts yet | 2s | 64 MB | Judgeable |
| ArtemisGiven N points with distinct x and y, find the axis-parallel rectangle with two opposite corners on points that contains at least T points and the fewest total points. | Hard8 | Prefix sumBinary search+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Bubble SortSwap exactly one pair of elements in the array, then find the minimum number of swaps the given bubble sort performs on the result. | Hard8 | SortingPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Habitat Range of FishGiven up to 50 axis-aligned boxes in 3D, compute the total volume covered by at least K of them. | Hard8 | SortingDivide and conquer+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JOI National FestivalGiven a connected weighted graph with some festival cities, answer queries asking for the largest possible minimum distance-to-festival along any path between two cities. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ExpositionSplit N points in the plane into two nonempty groups minimizing the largest Manhattan distance within any group. | Hard8 | Binary searchGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Ladder GameGiven a ladder with n lines and m rungs, erase at most one rung to minimize the sum of scores reached from the leftmost k starting lines. | Hard8 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Area and Perimeter of a Union of RectanglesGiven up to 10000 axis-parallel rectangles on an integer grid, compute the area of their union (and its perimeter when r=2), counting overlaps once. | Hard8 | Segment treeSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Garden FenceChoose a line through two boundary points splitting the field into two sides; minimize the total value of trees cut down. | Hard8 | GeometrySorting+1 | No attempts yet | 5s | 128 MB | Judgeable |
| File RecoverCount the distinct contiguous substrings that occur at least twice in a given string, for several test cases up to 100000 characters each. | Hard8 | StringString matching+1 | No attempts yet | 5s | 128 MB | Judgeable |
| PetanqueSimulate seven petanque throws where a moving ball travels along its direction, possibly striking other balls and transferring its remaining roll, then decide who owns the closest boule to the coche and count points. | Hard8 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cutting EdgeGiven non-overlapping rectangles that tile a big pane, output the sequence of edge-to-edge cuts (smallest X1, then smallest Y1 first) that separates every rectangle. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Secure RegionGiven an axis-aligned field and up to 300 mines, find the axis-aligned mine-free rectangle with the largest shorter side, then the largest longer side. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Detour BusterGiven a piecewise-linear track, find the shortest distance from the first point to the last while staying on the track, allowing travel in either direction. | Hard8 | GeometryGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Rotation ParityDecide the parity of the number of 2x2 clockwise rotations needed to sort a permutation of an R x C grid into row-major order. | Hard8 | MathCombinatorics+2 | No attempts yet | 5s | 256 MB | Judgeable |
| ElephantsAfter each of M moves that relocate one elephant, report the minimum number of length-L segments needed to cover all current positions. | Hard8 | Segment treeDynamic programming+2 | No attempts yet | 12s | 256 MB | Judgeable |
| Hill WalkGiven non-crossing slanted segments, simulate Bessie climbing each hill and falling straight down at its upper end, counting the distinct hills she touches. | Hard8 | SortingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TaxiBessie drives one cow at a time along a fence of length M, may drop cows short of their goals, starts at 0 and ends at M; find the minimum total driving distance. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Route DesignGiven two banks of valued sites and a set of non-crossing routes, find the maximum total value of a tour that alternates between banks without intersecting routes. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Scrambled LettersGiven N scrambled names, find for each the lowest and highest rank its original anagram could occupy in an alphabetical ordering of all cows. | Hard8 | StringSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Buying FeedBuy at least K pounds of feed from stores along a 1D route, paying purchase cost plus K^2 cents per mile for the load carried, and minimize the total. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Cow TreatsSimulate a greedy process on a W by H grid where rows and columns may be swapped to place the highest remaining value in the earliest reachable slot. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AllowanceGiven coin denominations where each divides the next and bounded supplies, find the maximum number of weeks you can pay at least C each week. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow Toll PathsFor each query, find the cheapest s-t trip where cost is the sum of edge tolls plus the single largest pasture toll on the route. N=250, K=10000. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Barn AllocationGiven stall capacities and interval requests, find the maximum number of requests that can be granted without any stall exceeding its capacity. | Hard8 | GreedySegment tree+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Test TakingGiven N questions and a set of possible true-counts, choose a true/false answer key maximizing the worst-case number of correct answers. | Hard8 | MathGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Water SlidesOn a DAG where each node leading to the sink, Bessie maximizes her worst-case path sum when up to K times she is forced down the worst outgoing edge. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangle CountingCount how many triangles formed by triples of N integer points strictly contain the origin in their interior. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Game PredictionGiven your n distinct cards in an m-player game where every card from 1 to n*m is dealt, find the most rounds you can guarantee to win against any opponent play. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ExamsCount subsets of at most 36 positive exam scores whose sum is at least T, where each score can be as large as 10^13. | Hard8 | Bit manipulationBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Haybale GuessingGiven interval minimum queries with distinct values, find the earliest query that makes the whole set of answers inconsistent. | Hard8 | Binary searchSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Grabbing LandSplit N rectangles into groups, each group costing the product of its max width and max height, minimizing the total cost. | Hard8 | SortingDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Flood FillGiven M points and a threshold D, group points whose taxicab distance is at most D into connected components, then report the number of components and the largest component size. | Hard8 | Union-findSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Milk PatternsGiven N integers, find the length of the longest contiguous subsequence that repeats at least K times, counting overlapping occurrences. | Hard8 | String matchingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Circle ArtworkGiven up to 100 colored points, count how many colors have a circle through two of their points that contains no point of another color. | Hard8 | GeometryBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Against MammothsAssign each human planet to at most one alien planet and pick a launch year so the fleet wins on arrival, minimizing the year the last alien falls. | Hard8 | Binary searchGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangles and QuadrangleGiven two triangles and a quadrangle, decide whether the triangles can be joined along a full edge, without overlap, to form the quadrangle up to translation, rotation, and reflection. | Hard8 | GeometryImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Quelling BladeGiven a tree of weapon prerequisites with costs and benefits, find a buying order that reaches the root in minimum time while maximizing the sum over time of owned benefit. | Hard8 | GreedyDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IntervalsGiven n integer intervals each needing at least c_i chosen points inside it, find the smallest set of integers satisfying all requirements. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TimetableGiven a network of direct train legs, compute all Pareto-optimal journeys from city 1 to city n, where one journey dominates another if it departs no earlier and arrives no later. | Hard8 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IntervalsGiven a point light above the x-axis and non-overlapping circular pipes below it, find the shadowed intervals on the x-axis, sorted and rounded to two decimals. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| XenosemanticsFind words over lowercase letters delimited by varying spacer letters in a bit stream, then report the distinct true words that repeat and overlap another true word. | Hard8 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| StarsCount and find the brightest occurrence of each constellation pattern as a direct similarity transform of integer points within a star map. | Hard8 | GeometryHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Simon the SpiderPick a connected spanning subgraph minimizing total edge weight minus twice the heaviest chosen edge, or report that the graph is disconnected. | Hard8 | Minimum spanning treeGraph+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Simple PolygonGiven up to 40,000 points defining a closed polygon, decide whether its edges only meet at shared endpoints (simple) or intersect anywhere (NO). | Hard8 | GeometrySorting+2 | No attempts yet | 10s | 128 MB | Judgeable |
| Go EndgameGiven starting scores, region values, and sente flags, compute the final scores when Alice and Bob alternately pick regions and respond until all are settled. | Hard8 | Dynamic programmingGame theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BoatherdsGiven a weighted tree and up to 100 queries, decide for each target value whether some pair of vertices has a path cost exactly equal to it. | Hard8 | Divide and conquerTree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Subway PlanningGiven points in the plane and a radius d, cover all points using the fewest rays from the origin, where a ray covers a point if some point on the ray is within distance d. | Hard8 | GeometryGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Software CompanyAssign m subprojects of each of two projects to n employees, who work sequentially, to minimize the largest total working time. | Hard8 | Binary searchGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Winds of WarChoose a convex net containing the origin that covers as many enemy units as possible while covering as few friendly ones, and report the maximum difference. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SnailsEach of N snails moves in a fixed direction at speed 1 and stops at the fence, at any point an earlier snail crossed, or when it meets another snail simultaneously; find when the last snail stops. | Hard8 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CloudsEach cloud is a polygon moving with the same velocity; count the separate time intervals during which the vertical beam at the origin intersects at least one cloud. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Can of WormsFor each can, count how many cans explode when it is shot, following the chain reaction where each blast hits cans within its radius. | Hard8 | SortingBinary search+2 | No attempts yet | 3s | 128 MB | Judgeable |
| RobotsRobots on a circular track move clockwise for given durations, pushing each other and stopping at walls; find each final position. | Hard8 | SimulationIntervals+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Coat RackSort garments and targets; sliding garments keeps their order and may stack them, so assign each target to a position minimizing total distance under order constraints. | Hard8 | Dynamic programmingDivide and conquer+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| KortosCount the distinct ordered piles a player can build from N distinct cards where each new card matches the top card's number, or matches its suit with a larger number, modulo 1e9+7. | Hard8 | Dynamic programmingCombinatorics+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| Fortune at El DoradoGiven up to 1000 points on a 1000x1000 grid and a maximum area A, find an axis-parallel rectangle with positive integer area at most A containing the most points. | Hard8 | Two pointersBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Intercepting MissilesGiven moving bombers and passenger planes plus fixed missile launchers, find the maximum number of bombers that can be shot down without hitting any passenger plane. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| University Entrance ExaminationGiven students with scores, home regions, and program preference lists, plus program capacities, assign students to programs under a local-region priority rule and a fairness rule. | Hard8 | ImplementationGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Museum Heist: Area of the Shadowy RegionsGiven an axis-aligned rectangle with non-overlapping rectilinear polygonal obstacles and a gun at the upper-right corner, find the total area of points no monotone beam can reach. | Hard8 | GeometrySimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Farmer Bill's ProblemPlace non-overlapping, non-touching rectangles inside a rectangular field so all given circles lie within them, minimizing total rectangle area, and output the remaining harvestable area. | Hard8 | GeometryDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |