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,924 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
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.Hard8GeometrySorting+2No attempts yet1s128 MBJudgeable
Strictly Inscribed Similar TrianglesFor each triangle and angle theta, count how many strictly inscribed triangles similar in order to the given triangle exist with a chosen edge at that angle.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
Doing WindowsGiven a screen and four windows with fixed aspect ratios, decide whether the windows can be resized and placed to tile the screen with no gaps or overlaps.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
StarsCount and find the brightest occurrence of each constellation pattern as a direct similarity transform of integer points within a star map.Hard8GeometryHash map+2No attempts yet1s128 MBJudgeable
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).Hard8GeometrySorting+2No attempts yet10s128 MBJudgeable
No SmokingGiven up to 200 disjoint rectangles in a town rectangle, decide whether some point in the town lies at distance at least D minus 0.1 from every building.Hard8GeometryUnion-find+2No attempts yet3s128 MBJudgeable
Pyramid GuardsTwo guards walk opposite closed quadrilateral loops on a square pyramid's surface; find the minimum straight-line distance between them while they share a face.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
Robotic RailsGiven up to 100 line segments in the plane, find the shortest path from a fixed start point and heading to a fixed target point and heading, where turns at intersections may not exceed 90 degrees.Hard8GraphGeometry+2No attempts yet10s128 MBJudgeable
Paper CuttingFor each test case, decide whether an A by B grid of C by D cards fits on an E by F sheet in some rotation, then report the minimum number of straight cuts needed to separate the cards.Hard8MathGreedy+2No attempts yet1s128 MBJudgeable
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.Hard8GeometryGreedy+2No attempts yet1s128 MBJudgeable
Request for PermissionGiven a convex country, M nearest-station Voronoi cells, and a straight flight segment outside the border, list the cells the flight crosses in order.Hard8GeometryBrute force+2No attempts yet1s128 MBJudgeable
Connected GheevesGiven two convex funnel-shaped containers joined at the bottom, find the water level reached after pouring a given area of water, capped at the lower rim.Hard8GeometryBinary search+2No attempts yet1s128 MBJudgeable
Rotating ScoreboardGiven a simple polygon, decide whether some interior point sees every boundary point, which happens exactly when the polygon's kernel is nonempty.Hard8GeometryImplementation+2No attempts yet1s128 MBJudgeable
ACM UndergroundGiven metro lines, policemen on them, and two points, decide whether the destination is reachable without ever being checked, where checks happen at line changes and at non-intersection spots on lines.Hard8GeometryGraph+2No attempts yet1s128 MBJudgeable
Transforming CometsGiven two cyclic sequences of integer points, decide whether one is a rotation, uniform positive scaling, and translation of the other, and report the matching cyclic offset.Hard8String matchingGeometry+2No attempts yet5s512 MBJudgeable
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.Hard8GeometrySorting+2No attempts yet2s512 MBJudgeable
Beware the GeoducksGiven two fixed walking routes on a weighted graph, decide whether the two travelers ever occupy the same point within t seconds, accounting for nodes with geoducks that make a traveler vanish.Hard8ImplementationSimulation+2No attempts yet1s128 MBJudgeable
JengaismSimulate Jenga moves (remove a block, place it on top) and report when any structure topples because its center of gravity leaves the convex hull of its supports.Hard8GeometrySimulation+2No attempts yet1s128 MBJudgeable
Concentration CardsGiven N cards of size W by H that can each be rotated, tile a filled rectangle with them and find the smallest possible perimeter.Hard8MathGeometry+2No attempts yet1s128 MBJudgeable
CubeGiven an n by n by n grid of letters, decide whether the connected same-letter pieces can be pulled apart without cutting, meaning no single piece separates the cube.Hard8GraphDFS+2No attempts yet1s128 MBJudgeable
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.Hard8GeometrySimulation+2No attempts yet1s128 MBJudgeable
Chain-Confined PathFor a chain of circles where consecutive circles overlap, find the shortest path from the first center to the last center that stays inside the union of the circles.Hard8GeometryShortest path+2No attempts yet1s128 MBJudgeable
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.Hard8GeometrySorting+2No attempts yet2s128 MBJudgeable
CircleGiven grid side k and circle radius r centered at a grid vertex, count cells the circle passes through, excluding cells touched only at a corner.Hard8MathGeometry+2No attempts yet1s128 MBJudgeable
Similar PolygonsDecide whether two polygons are similar, and if so print the square of the similarity factor as a reduced fraction and the matching vertex index in the second polygon.Hard8GeometryString matching+2No attempts yet1s1024 MBJudgeable
Similar PolygonsDecide whether two polygons are similar under rotation, reflection, translation, and scaling, then output the exact squared similarity ratio and the smallest matching vertex index.Hard8GeometryString matching+2No attempts yet1s1024 MBJudgeable
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.Hard8GeometryBinary search+2No attempts yet1s128 MBJudgeable
Map LabelerGiven city points in the plane, find the largest square label size so that each label has its city at the midpoint of its top or bottom edge and no two label interiors overlap.Hard8Binary searchGeometry+2No attempts yet1s128 MBJudgeable
Blue x Red = BangGiven up to nine blue and nine red points, decide whether a simple blue polygon and a simple red polygon can be drawn with disjoint interiors and boundaries.Hard8GeometryBrute force+2No attempts yet1s128 MBJudgeable
JaWsGiven two rows of equilateral triangles, drop the upper row onto the lower one and report where it settles or which side it slides off.Hard8GeometrySimulation+1No attempts yet1s128 MBJudgeable
The Bermuda TriangleGiven a regular hexagon of side s and allowed equilateral triangle sizes, decide whether the hexagon can be tiled exactly by triangles of those sizes.Hard8BacktrackingGeometry+2No attempts yet1s128 MBJudgeable
Color TunnelsGiven a color sequence and colored line-segment tunnels, find the shortest path from source to destination that traverses tunnels in the required color order.Hard8GeometryShortest path+1No attempts yet1s128 MBJudgeable
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.Hard8GeometrySimulation+2No attempts yet1s128 MBJudgeable
FarmlandGiven a planar graph of farming regions, count the proper regions bounded by a simple cycle with no interior vertices or edges and exactly k boundary edges.Hard8GraphGeometry+2No attempts yet1s128 MBJudgeable
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.Hard8GeometryDynamic programming+2No attempts yet2s128 MBJudgeable
HypertransmissionGiven N points in 3D each labeled 0 or 1, choose a squared radius R^2 to maximize the number of points where opposite-label neighbors outnumber same-label ones, then report that maximum and the smallest R^2 achieving it.Hard8SortingPrefix sum+2No attempts yet1s128 MBJudgeable
Inlay CuttersCount all 45-degree right isosceles triangles formed by grid-aligned cuts and diagonals on an M by N plate after K straight cuts.Hard8GeometryImplementation+2No attempts yet1s128 MBJudgeable
LibraryGiven shelf and peg geometry in a niche, find a redesign that seats a fixed tome on one shelf while minimizing pegs moved and plank cut.Hard8GeometryBrute force+2No attempts yet1s128 MBJudgeable
FrontierChoose a subset of the polygon's vertices, in clockwise order, forming a convex polygon that strictly contains all given points, minimizing its perimeter.Hard8GeometryDynamic programming+2No attempts yet1s128 MBJudgeable
FenceCompute the total illumination reaching the lit parts of a polygonal fence from a point lamp, accounting for shadows and the cosine obliquity factor.Hard8GeometryImplementation+2No attempts yet1s128 MBJudgeable
EllipseGiven five integer points, either report that no unique ellipse passes through them or compute that ellipse's area to six decimals.Hard8GeometryMath+2No attempts yet2s64 MBJudgeable
JoggingGiven N pairs of one-way moving walkway lines in the plane with boarding and leaving costs, find the minimum travel time from house to office where walking off-line is allowed.Hard8Shortest pathGeometry+2No attempts yet1s512 MBJudgeable
Box ArtGiven a bounding box and up to 2000 axis-aligned boxes, compute the volume of their union clipped to the bounding box.Hard8GeometrySorting+2No attempts yet1s128 MBJudgeable
FrogGiven axis-aligned non-touching squares in the first quadrant and a jump reach d, find the largest x+y over squares reachable from the square at the origin.Hard8GraphBFS+2No attempts yet1s128 MBJudgeable
Lattice Points in the Union of CirclesCount integer lattice points inside the union of up to 10,000 circles, restricted to the coordinate box from -16383 to 16384.Hard8GeometrySorting+2No attempts yet1s128 MBJudgeable
The RaceCount all overtakes among spaceships with given starting positions and speeds, then list the first 10000 in time order.Hard8SortingGreedy+2No attempts yet1s128 MBJudgeable
Fish CatchGiven a fixed net center and N fish moving at constant velocity, find the smallest radius that catches at least K fish at some time t >= 0.Hard8GeometryBinary search+1No attempts yet1s128 MBJudgeable
Space BoomerangGiven M direction vectors in N-dimensional space, find every vector that cannot appear with a nonzero coefficient in any linear combination summing to zero.Hard8MathGeometry+1No attempts yet3s128 MBJudgeable
Empty TrianglesGiven N lines with no three concurrent, count the triangles whose interior is not crossed by any other line.Hard8GeometryCombinatorics+1No attempts yet2s512 MBJudgeable
Equilateral DominoesGiven up to 6 equilateral dominoes with pip values 1 to 6, tile a connected subset on the triangular grid to maximize shared edges between adjacent matching ends.Hard8BacktrackingGeometry+2No attempts yet15s128 MBJudgeable
Globulous GumdropsGiven spheres of radii r_i and a tube of diameter d, find the shortest cylinder length holding them all.Hard8GeometryDynamic programming+2No attempts yet1s128 MBJudgeable
Planet HuntingGiven the moon's positions at three times and the planet's period, find the star to planet distance by solving for the orbital phase.Hard8GeometryMath+1No attempts yet1s128 MBJudgeable
Cover All Points with Three SquaresFind the smallest integer side length d so that three axis-aligned d×d squares can cover all N given points.Hard8Binary searchGreedy+2No attempts yet2s64 MBJudgeable
Painting PatternsCount grid cells painted black by up to N rectangle operations, each applying one of three periodic patterns under OR overlap.Hard8GeometryPrefix sum+2No attempts yet2s64 MBJudgeable
Collision of AsteroidsGiven two moving convex hulls in 3D, decide whether they overlap at some past or future time.Hard8GeometryBinary search+1No attempts yet1s16 MBJudgeable
Union Area of TrianglesGiven right isosceles triangles with axis-parallel legs and hypotenuse of slope -1, compute the area of their union.Hard8GeometrySegment tree+2No attempts yet1s32 MBJudgeable
GridGiven n points, decide whether there exist an axis-aligned grid of evenly spaced lines and a straight line whose intersection set is exactly those points.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
CorridorFind the largest radius of a sphere that can travel west to east through a corridor, where point pillars and the two side walls block it.Hard8GraphShortest path+2No attempts yet1s128 MBJudgeable
Almost ClearGiven two disjoint convex polygons A and B and a point C outside both, decide whether B hides none, part, or all of A as seen from C.Hard8GeometryBinary search+2No attempts yet1s128 MBJudgeable
Worst LocationsGiven a perfect binary tree and two distance-from-leaf descriptions, decide whether some pair of matching vertices sits farther than Z apart.Hard8TreeGeometry+2No attempts yet1s128 MBJudgeable
Road AccidentFind which quarter-part of each car (corner plus adjacent side halves) first touches the other car during straight-line motion before impact.Hard8GeometrySimulation+1No attempts yet1s128 MBJudgeable
Closest PointFor each of N points, output the squared distance to the nearest other point.Hard8Divide and conquerSorting+2No attempts yet3s128 MBJudgeable
The PicnicGiven up to 99 points, find the largest convex polygon whose vertices are points and whose interior contains no other point.Hard8GeometryDynamic programming+2No attempts yet1s128 MBJudgeable
The Curious PrinceFind the shortest path along the surface of a convex polyhedron between two given points.Hard8GeometryShortest path+2No attempts yet1s128 MBJudgeable
Hallucinogenic CarnationsFor each of up to 10000 polygons, sum the carnations in grid parcels whose area at least half lies inside the polygon.Hard8GeometryPrefix sum+1No attempts yet1s128 MBJudgeable
RadioGiven a circle and a simple polygon, compute the area of the polygon's interior that lies inside the circle.Hard8GeometryArrayNo attempts yet1s128 MBJudgeable
Special Forces ManoeuvresDiscs cover the plane; find the smallest prefix of the given order whose union already covers the entire plane, or report NIE if no prefix does.Hard8GeometryBinary search+2No attempts yet3s512 MBJudgeable
P-Broken-LineFind the minimum number of axis-parallel unit-free segments in an orthogonal polyline from A to B that avoids all n given axis-parallel obstacles.Hard8BFSGraph+2No attempts yet3s512 MBJudgeable
Empty CuboidsGiven up to 5000 integer points, find the largest axis-aligned box anchored at the origin whose strict interior contains none of the points, and output its volume.Hard8SortingTwo pointers+2No attempts yet3s128 MBJudgeable
RocketsMatch the n red points to the n white points with non-crossing segments so the total Euclidean length is minimum, and report the matching.Hard8Dynamic programmingDivide and conquer+2No attempts yet1s128 MBJudgeable
AltarsFor each rectangle temple, decide whether a ray from its center can exit through the half-wall entrance and escape to infinity without touching any rectangle.Hard8GeometryImplementation+1No attempts yet1s128 MBJudgeable
PolygonGiven a convex polygon and its triangulation, find the maximum number of triangulation triangles a single elementary triangle can intersect.Hard8GeometryDynamic programming+1No attempts yet1s128 MBJudgeable
WindowGiven an orthogonal polygon and an axis-parallel window, count how many separate interior fragments of the polygon are visible through the window.Hard8GeometryImplementation+1No attempts yet1s128 MBJudgeable
Flat Broken LinesGiven n points, find the minimum number of flat broken lines (each moving right with segment slopes between -1 and 1) needed to cover all points.Hard8GreedySorting+1No attempts yet1s128 MBJudgeable
CastleGiven an orthogonal simple polygon with corridor grid lines inside it, find the shortest path along grid lines between two marked lattice points.Hard8GraphShortest path+1No attempts yet1s128 MBJudgeable
WarehouseFind a crossroads minimizing the weighted sum of Chebyshev distances to n shops.Hard8GeometryBinary search+2No attempts yet1s128 MBJudgeable
The InvasionGiven a convex polygon with n vertices and m weighted points, find three polygon vertices forming a triangle with the maximum total weight of points inside or on it.Hard8GeometryTwo pointers+2No attempts yet3s64 MBJudgeable
Mirror TrapGiven a rectilinear polygon, pair up its corners by tracing 45-degree laser beams that reflect off mirror walls until each beam lands in another corner.Hard8GeometrySimulation+2No attempts yet1s128 MBJudgeable
SheepCount triangulations of a convex n-gon by non-crossing diagonals such that no diagonal passes through a sheep's spot and every triangle holds an even number of spots, modulo m.Hard8Dynamic programmingGeometry+2No attempts yet3s512 MBJudgeable
LampGiven rectangular windows on two parallel walls 10 m apart and a lamp on one wall, count the windows of the lamp's building whose interior any reflected ray can reach.Hard8GeometryImplementation+2No attempts yet5s512 MBJudgeable
PlotPartition a sequence of n points into at most m contiguous groups, replacing each group with one point, to minimize the maximum distance from any original point to its group's representative.Hard8Binary searchDynamic programming+2No attempts yet30s128 MBJudgeable
TapestriesDecide whether a point strictly inside a simple polygon sees each edge as entirely lit or entirely dark, matching a given lit/dark pattern per wall.Hard8GeometryDivide and conquerNo attempts yet1s128 MBJudgeable
ScissorsGiven a rectilinear simple polygon, find the minimum number of drawn segments (each with endpoints on the boundary and interior inside) so that cutting along them makes every piece a rectangle.Hard8GeometryGraph+2No attempts yet1s128 MBJudgeable
FosaGiven horizontal and vertical segments, find the largest axis-aligned square whose entire perimeter lies on those segments, or report that none exists.Hard8GeometrySorting+1No attempts yet1s128 MBJudgeable
TrailsFor each axis-aligned unit-height tape, count the connected pieces of the bytecurve of order n that lie inside the rectangle.Hard8Divide and conquerRecursion+2No attempts yet1s128 MBJudgeable
Map 2Count integer starting points (a,b) such that each of the four diagonal quadrants around (a,b) contains at least one of n marked points.Hard8SortingPrefix sum+2No attempts yet1s128 MBJudgeable
Near 2Given n tree points and m apple points, find the minimum over all apples of the Manhattan distance to the nearest tree.Hard8Divide and conquerGeometry+2No attempts yet1s128 MBJudgeable
CloudsGiven disjoint simple polygons and a fixed wind direction, place a point so the number of polygons that cross the vertical ray above it at some time is maximized.Hard8GeometrySorting+2No attempts yet1s128 MBJudgeable
SegmentsGiven n disjoint vertical segments, find the maximum possible number of pairs that can see each other via an unobstructed horizontal segment.Hard8GeometryCombinatorics+1No attempts yet1s128 MBJudgeable
Straight LinesGiven two crossing lines and an integer point, find the integer point in the same region that is closest to the intersection, breaking ties lexicographically.Hard8GeometryMath+2No attempts yet1s128 MBJudgeable
The TempleGiven circles (columns) and two points, find the shortest path between the points that cannot pass through any circle.Hard8GeometryGraph+2No attempts yet1s128 MBJudgeable
Sum of PolygonsAdd two convex polygons by Minkowski sum and print twice the area of the resulting polygon.Hard8GeometryTwo pointers+2No attempts yet1s128 MBJudgeable
ScreensaverA point moves diagonally and reflects off a set of disjoint horizontal and vertical wall segments; report its position after t seconds.Hard8GeometrySimulation+2No attempts yet1s128 MBJudgeable
Jasiek's DrawingGiven a counter-clockwise walk around a polyomino's border cells, count the total number of blackened cells in the drawing.Hard8GeometryImplementation+1No attempts yet1s128 MBJudgeable
NinjaGiven n points in the plane, decide whether two disjoint non-crossing polylines can connect point 1 to 2 and point 3 to 4 using points as vertices.Hard8GeometryGraphNo attempts yet1s128 MBJudgeable
Express DeliveryGiven a depot and clients with distinct x and y coordinates, find the fewest monotone (shortest-path) routes from the depot that cover all clients.Hard8GreedySorting+2No attempts yet1s128 MBJudgeable
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.Hard8GeometryGreedy+2No attempts yet1s128 MBJudgeable
BajtoriSelect a subset of squares to maximize the sum of the squared red total and squared green total.Hard8GeometrySorting+1No attempts yet1s128 MBJudgeable
Fence In Godzilla!The task is to find the smallest nonzero area among triangles with vertices from n points.Hard8GeometrySorting+1No attempts yet1s128 MBJudgeable
VirusesGiven up to 24 virus sources with distinct daily hours, determine how many cells each one ends up occupying on an n by n board.Hard8GeometryBFS+2No attempts yet1s128 MBJudgeable