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 results1,917 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Counting Bow TiesCount 4-cycles in a bipartite graph defined by M rectangles over vertex ranges, with N up to 1e9. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Warp DrivePlace two warp points on the plane to minimize the root mean square of flight times, where each time is min(direct, dist to nearest warp) divided by speed. | Hard8 | GeometryBrute force+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Minimum Diameter SumSplit a set of n planar points into two nonempty groups so that the sum of the two group diameters is minimized, and print the value. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 512 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 |
| Magic Towers and TeleportationDecide whether repeatedly reflecting the whole set of points across three fixed towers can turn one given point multiset into another, with soldiers considered indistinguishable. | Hard8 | GeometryMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Keeping the Dogs ApartTwo dogs follow their own polyline routes at the same constant speed; find the minimum distance between them while both are still walking. | Hard8 | GeometryTwo pointers+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Cover the Polygon with Your DiskPlace a fixed-radius disk anywhere on the plane to maximize the area shared with a convex polygon, and print that maximum. | Hard8 | GeometryBinary search+1 | No attempts yet | 3s | 512 MB | Judgeable |
| Number of RegionsGiven A and B, count the regions into which the A times B lines y = ax + b with 0 <= a < A, 0 <= b < B divide the plane. | Hard8 | CombinatoricsGeometry+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Segments in a Regular PolygonCount the orders in which the remaining polygon vertices can be visited so each new segment crosses an existing one and the path closes back to P0. | Hard8 | BacktrackingDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Counting ear shapesCount quadruples of red points and pairs of blue points forming an ear shape with angle and containment conditions. | Hard8 | GeometryBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Distance to the nearest pointFor each of N points, report the Manhattan distance to the nearest other point. | Hard8 | GeometryDivide and conquer+1 | No attempts yet | 2s | 512 MB | Judgeable |
| RoomGiven points on the edges of an unknown orthogonal monotone polygon with edge orientations, reconstruct it and output its perimeter or -1 if impossible. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Olympic Gold AthletesEach athlete's skill and fatigue change linearly in time; count those who are the unique max-skill and unique min-fatigue athlete at some time t >= 0. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Rectangular PlazaCount axis-aligned rectangles whose corners include two given lamps and whose interior contains no other lamp, given all X and Y coordinates are distinct. | Hard8 | GeometrySorting+1 | No attempts yet | 1s | 512 MB | Judgeable |
| BalloonGiven N disjoint ceiling segments, trace each vertically rising balloon as it sticks to horizontal segments or slides to the higher endpoint of tilted ones, and report the final resting point or escape x coordinate. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Marble slideA ball rolls down alternating left and right fins, and we must find the largest diameter for which it still slides all the way to the bottom instead of getting wedged. | Hard8 | GeometryBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| War Among the StarsCompute the shortest distance between two tetrahedra in space, given the coordinates of their eight vertices. | Hard8 | GeometryImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Scientists' RegattaGiven start, finish, and non-intersecting segment obstacles in the plane, compute the shortest path that never crosses a segment interior. | Hard8 | GeometryShortest path+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Ghostbusters 2Assign each of N points a horizontal or vertical cross arm of equal length P so no two same-orientation arms intersect; find the max P or report UNLIMITED. | Hard8 | GeometryBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| EnclosureGiven k controlled points forming a convex hull, add one of the remaining points to maximize the hull area, and print the resulting area to one decimal. | Hard8 | GeometryGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Maximum Tent VolumeAssign n poles of given heights to a central hole and n-1 fixed holes around it to maximize the total volume of the resulting triangles. | Hard8 | GeometryDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Individually Customised Pop-up CardsFor a pop-up card folding on parallel axes, find the minimum distance to move the contact point (Xp,0) so a matching second segment exists. | Hard8 | GeometryMath+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Sky JumpGiven N engines that instantly set velocity, each usable once, decide if the gravity-driven missile starting at the origin can pass through a target point. | Hard8 | MathGeometry+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Alice and the BombGiven disjoint polygons, a bomb point, and Alice at the origin, find the shortest path she runs outside all polygon interiors until some building blocks the blast to the bomb. | Hard8 | GeometryShortest path+2 | No attempts yet | 8s | 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 |
| Neko's TreasureGiven n disjoint-or-nested circles, choose a valid subset so the rat crossing from its lair to the bed crosses the fewest walls. | Hard8 | GeometryBFS+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Dig or ClimbGiven a polyline terrain cross-section, find the shortest travel time from the first point to the last, walking along the surface or tunneling horizontally between two same-height points whose interior stays below the terrain. | Hard8 | GraphShortest path+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Rotation EstimationGiven two unordered point sets related by a rotation plus translation, find the smallest counterclockwise rotation angle in [0, 2pi) that maps the first set onto the second. | Hard8 | GeometrySorting+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Colony MaintenanceGiven up to 16 unit cubes forming a connected polycube, find the shortest path over its exposed surface between two points, with moves constrained by the three surface-adjacency cases. | Hard8 | GraphBFS+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Turn PolygonsGiven a rotating polygon around a center and a fixed convex polygon inside it, find the angle until the two polygons first touch. | Hard8 | GeometryBinary search+2 | No attempts yet | 8s | 512 MB | Judgeable |
| The Extreme SlalomGiven up to 12 disjoint line-segment gates in order, find the shortest path that touches each gate in sequence. | Hard8 | GeometryDynamic programming+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Light the RoomGiven an orthogonal polygon room with a lamp, trace rays that reflect once off the walls and find the total wall length left unlit. | Hard8 | GeometrySimulation | No attempts yet | 8s | 512 MB | Judgeable |
| Counting Self-Rotating SubsetsFor each size i, count the subsets of the given N points that a nontrivial rotation maps onto themselves, modulo 1e9+7. | Hard8 | GeometryCombinatorics | No attempts yet | 2s | 512 MB | Judgeable |
| Find CGiven lattice points A and B, list K lattice points C such that both segments AC and BC are primitive and triangle ABC contains no other lattice point. | Hard8 | Number theoryGeometry+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Flyswatter placementsCount the integer translations of a fixed polygon that keep it inside an axis-aligned rectangle and avoid all given points, including points on the boundary. | Hard8 | GeometryPrefix sum+2 | No attempts yet | 1s | 256 MB | Judgeable |
| CruiseChoose a closed polygonal cruise from Piraeus through the islands so that collected point value divided by route length is maximized. | Hard8 | GeometryDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Jenga BoomSimulate removals from a Jenga-like tower and report whether it falls, and at which removal, when a level's center of mass leaves the convex hull of the blocks still supporting it. | Hard8 | GeometrySimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Solar FlightFor a line segment query, find the maximum total intercept-weight above a given ray over all x in a length-K window. | Hard8 | GeometrySorting+2 | No attempts yet | 15s | 512 MB | Judgeable |
| Zombie ApocalypseGiven up to 2000 zombie cells on an N by M grid with Chebyshev distance spreading, count how many cells end up at level Q. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| FenceSum x! times y! over all unit cells inside an axis-aligned polygon, modulo 1e9+7, with coordinates up to 1e9. | Hard8 | MathPrefix sum+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Quadrilateral blanketGiven N points and an area limit L, pick four points forming a simple quadrilateral with area at most L, maximizing that area. | Hard8 | GeometryBrute force+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Painting SquaresAn infinite canvas starts white; each step picks the largest monochrome axis-aligned square of side at most D centered at a given point and flips its color. Find the final black area. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TrufflesGiven a grid of per-meter values, compute for each of M slanted lines the weighted length integral of the line through the grid, rounded to five decimals. | Hard8 | GeometryPrefix sum+1 | No attempts yet | 3s | 128 MB | Judgeable |
| VirusFind the rational point (X, Y, Z) closest to the origin satisfying N linear inequalities in three variables, or report that none exists. | Hard8 | GeometryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ElectricityPlace a power plant at an integer intersection minimizing the sum over axis-aligned rectangles of the Manhattan distance to the nearest rectangle corner. | Hard8 | GeometryBinary search+1 | No attempts yet | 1.5s | 128 MB | Judgeable |
| Median filterGiven a piecewise-linear integer signal by its corner points, output the corners of its median-filtered signal of width 2d+1. | Hard8 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangle regionsGiven N points with no three collinear, count for each v how many triangles formed by three points contain exactly v other points strictly inside. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Sticks and CarrotsChoose a subset of at least three vertices of a convex polygon so every carrot lies strictly inside the new polygon, minimizing its area. | Hard8 | GeometryDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| I Teach SweepingGiven segments in the first quadrant, find a line through the origin that intersects the most segments and report that count. | Hard8 | GeometrySorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Gallery of Pillars (Small)Count the pillars in an N by N grid that are visible from the corner viewpoint, given identical circular pillars of radius R whose centers sit at cell centers. | Hard8 | GeometryNumber theory+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Gallery of Pillars (Large)Count grid cells whose pillar is visible from a corner viewpoint, where pillars are radius-R circles and another pillar blocks the line of sight. | Hard8 | Number theoryMath+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Radioactive Islands (Small)Find the minimum radiation dose for a boat crossing from (-10, A) to (10, B) at speed 1, given 1 unit/hour plus 1/D^2 per island at (0, C_i). | Hard8 | GeometryMath+2 | No attempts yet | 30s | 512 MB | Judgeable |
| Rebel Against the Empire (Large)Given moving asteroids, minimize the maximum jump distance so that no gap between jumps exceeds S seconds. | Hard8 | GraphBinary search+2 | No attempts yet | 30s | 512 MB | Judgeable |
| The Unscrupulous KingdomWith n points in the plane and m existing edges, add the fewest edges (segments that avoid other points) so the graph is connected while maximizing the sum of squared lengths. | Hard8 | Minimum spanning treeUnion-find+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ParallelogramsGiven N points, produce a sequence of moves that translates one point to A+B-C each time, following a fixed published rule to bring every point into the first quadrant or report impossibility when all points are collinear. | Hard8 | GeometryImplementation+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Stars in a CanPlace all n points in 3D inside one cylinder of any orientation, with at least three stars on one base, and print the minimum possible volume. | Hard8 | GeometryBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Stretching StreamersCount ways to draw non-crossing chords among n points on a circle so the graph is a tree, edges only between numbers sharing a factor. | Hard8 | Dynamic programmingCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Over Fitting (Large)Given N labeled points in the plane, find a line whose positive half-plane contains only LOVELYZ points and maximizes how many LOVELYZ points it captures. | Hard8 | GeometrySorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Space ExplorationGiven N segment obstacles in the first quadrant and M rays from the origin, count how many segments no ray intersects, including exact endpoint touches. | Hard8 | GeometrySorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Airport ConstructionGiven a simple polygon with up to 200 vertices, find the longest line segment that lies entirely inside it. | Hard8 | GeometryBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Money for NothingPick one producer and one consumer to maximize (q-p)(e-d) over pairs where q>p and e>d, with up to 500000 of each. | Hard8 | Divide and conquerGeometry+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Strange Solutions at Jeong LabGiven a growing set of (A,B) pairs, decide each day whether the new pair is dominated by or lies on the segment between two existing points. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Jerry and TomDecide whether every mouse can be assigned to a visible hole on the polygon boundary, with each hole holding at most k mice. | Hard8 | GeometryGraph+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Leftmost SegmentGiven n segments spanning two horizontal lines, answer m queries asking which segment meets a horizontal line at the leftmost point, breaking ties by the upper endpoint. | Hard8 | SortingBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Omnicircumnavigation (Small)Given points on a sphere visited in order, decide whether the closed path along shortest arcs meets every great circle (every hemisphere) on the sphere. | Hard8 | GeometryMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Grid paper and trianglesCount ordered triples of lattice points in a (w+1) by (h+1) grid whose triangle has positive integer area, modulo 1e9+7. | Hard8 | CombinatoricsMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Horse tied outside the castleGiven a convex polygon and an exterior point with rope length L, compute the area reachable when the rope bends around polygon vertices and the two wrapping directions do not overlap. | Hard8 | GeometryMath+1 | No attempts yet | 0.1s | 16 MB | Judgeable |
| Rectilinear RegionsGiven two unbounded staircase polylines L and U, count the closed regions they enclose with L below and U above, and sum their areas. | Hard8 | GeometryTwo pointers+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| Flatland Fidget SpinnerGiven the pixel colors a camera recorded of a three-armed spinner, recover the camera's position and rotation angle. | Hard8 | GeometryBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Knight's MarathonOn a huge rectangular board, find the minimum number of knight moves from one square to another while staying inside the board. | Hard8 | MathBFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Easter EggsChoose a red egg set and a blue egg set from given plants, total N eggs, maximizing the minimum red-blue distance. | Hard8 | Binary searchGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Hoarse HorsesGiven line segments in the plane, count the maximum number of faces enclosed by them, i.e. bounded regions of their arrangement. | Hard8 | GeometryGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| HubtownAssign citizens to one of their two angularly nearest train rays, respecting each ray's capacity, and maximize the number assigned. | Hard8 | GreedySorting+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Abstract ArtGiven up to 100 simple polygons with 3 to 20 vertices each, compute the sum of their areas and the area of their union, each rounded to six decimals. | Hard8 | GeometryImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Distinct DistancesChoose any point q in the plane and minimize the number of distinct Euclidean distances from q to n given integer points. | Hard8 | GeometryMath+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Hot Sand and UmbrellasFind the minimum total time Kevin sprints on hot sand to go from the car to the ball and back, cooling at circular umbrellas, where each sun run is at most k seconds and the ball visit does not reset the limit. | Hard8 | GraphShortest path+2 | No attempts yet | 2s | 512 MB | Judgeable |
| DendroctonusDecide whether the infected and non-infected points can be separated by a single circle centered anywhere, where boundary non-infected points are allowed but interior ones are not. | Hard8 | GeometryBrute force+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Painting polygon outlinesFor each polygon side, split it at intersections with later polygons, then sum over the pieces where the depth t counts how many later polygons contain the piece. | Hard8 | GeometryImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Power plantsColor n points with two colors so the closest same-color pair is as far apart as possible, and output that squared distance plus the lexicographically smallest optimal coloring. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| IronmanFind the fastest path across n horizontal layers with different speeds, entering and exiting each layer boundary at an optimal x position, and print the minimum travel time. | Hard8 | Dynamic programmingMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Islands of WeenesiaFind the shortest tunnel between two circular islands whose entrance points sit at least 100 cm inside the rims, so that the reachability graph over islands becomes strongly connected. | Hard8 | GraphGeometry+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Building BridgesPick a subset containing the first and last pillars, pay (h_i-h_j)^2 for each bridge section and w_i for each skipped pillar, and minimize the total. | Hard8 | Dynamic programmingGreedy+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Archery TournamentMaintain a dynamic set of non-overlapping circles tangent to the ground, support insertions and point queries that remove the hit circle, and report which circle each arrow hits. | Hard8 | GeometryBinary search+2 | No attempts yet | 3s | 512 MB | Judgeable |
| BoxGiven a box with edges a, b, c and a w by h cardboard, decide whether some edge-aligned net of the box fits on the cardboard. | Hard8 | GeometryBrute force+2 | No attempts yet | 3s | 512 MB | Judgeable |
| The Final LevelFind the minimum number of L-shaped n-blocks needed to cover a connected path of squares from (0,0) to (a,b) on an infinite grid. | Hard8 | MathGreedy+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Fence InvasionCount how many distinct convex polygons can be formed as the convex hull of some subset of at least 3 of the given points, modulo 1e9+7. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Bang! Bang!Given lines and circles all passing through the origin, count how many regions the plane is divided into, treating duplicates as one shape. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Parallel LinesGiven up to 16 distinct points, pair them up to maximize the number of parallel pairs among the drawn segments. | Hard8 | Bit manipulationDynamic programming+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Making the Perimeter of the Convex Hull ShortestGiven n points, find the largest decrease in convex hull perimeter achievable by removing exactly two of the points. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Rendezvous on a TetrahedronTwo worms start at vertex A of a regular tetrahedron, crawl straight across faces reflecting off edges, and stop after integer trail lengths; decide whether they end on the same face. | Hard8 | GeometryImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Border WallGiven two colored point sets and a width d, find the minimum number of points to delete so that a strip of width d separates the remaining points by color. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Homotopic PathsDecide whether two polygonal paths from s to t in a plane with point obstacles are homotopic, that is, deformable into each other without crossing any tree. | Hard8 | GeometryImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Convex QuadrilateralGiven n points, find the smallest-area convex quadrilateral whose four sides each pass through at least two of the points and that contains every point. | Hard8 | GeometryGreedy+2 | No attempts yet | 9s | 512 MB | Judgeable |
| Off the RailsGiven n cities sorted by x, cover them with straight non-vertical segments so that the sum of squared vertical distances plus C per segment is minimized. | Hard8 | Dynamic programmingGeometry+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Blowing CandlesGiven up to 200,000 points inside a disk, find the minimum width of a strip that can cover all of them. | Hard8 | GeometryBrute force+2 | No attempts yet | 4s | 512 MB | Judgeable |
| Cat and MiceFind the smallest initial speed v so the cat can visit all points in some order, each arrival at or before its deadline, with speed multiplied by m after every meal. | Hard8 | Binary searchDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Umbral DecodingGiven up to 100 safe points (x, y, b), count lattice points (p, q) in the square [0, n]^2 that are not covered by any region |x-p|^3 + |y-q|^3 <= b. | Hard8 | GeometryMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Coin SliderChoose the largest subset of at most 16 coins and an order of moves so no moving coin ever collides with a stationary or already-moved coin. | Hard8 | GeometryBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Share the Ruins PreservationSplit points by a vertical line that avoids all points, build the minimum-area enclosing convex hull of each side, and minimize the total area. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Connect the DotsGiven a 4 by 4 grid labeled 1 to 16, find the minimum number of straight segments a continuous polyline needs so that the dots are visited in numeric order. | Hard8 | GeometryGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |