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
TitleLevelTopicsSolvedTime limitMemory limitJudge
TrójmiastoPick three of up to one million points in the plane so the sum of their three pairwise distances is smallest.Hard8GeometryDivide and conquer+1No attempts yet10s128 MBJudgeable
March of PrimalityPick a meeting point minimizing the latest arrival from N homes so the joint march still reaches the finish by time E.Hard8GeometryBinary searchNo attempts yet2s128 MBJudgeable
Kangaroo EnclosureCount the grid cells inside the smallest convex enclosure with horizontal, vertical, and diagonal sides that covers all marked cells.Hard8GeometryMathNo attempts yet1s128 MBJudgeable
Wi-Fi NetworkDecide whether a point in an open square sees all two or three computers through straight segments that cross none of up to 100 walls.Hard8GeometryBrute forceNo attempts yet1s128 MBJudgeable
Paper MapYou shift a fixed-size sheet grid over a simple polygon to minimize the sheets sharing positive area with its interior.Hard8GeometryBrute forceNo attempts yet20s128 MBJudgeable
Contour MapGiven up to 20000 non-crossing convex orthogonal polygons, compute the maximum nesting depth where the outermost level is 1.Hard8GeometrySorting+2No attempts yet3s128 MBJudgeable
PandoraGiven the left/right turn sequence of a rectilinear polygon, count the coordinate axes it is monotone with respect to.Hard8GeometryStringNo attempts yet1s128 MBJudgeable
Block CompactionRepeatedly drop axis-aligned rectangles down and then left until none moves, and report the width and height of the final bounding box.Hard8SimulationGeometry+2No attempts yet1s128 MBJudgeable
Opening a RestaurantCount the grid intersections that beat every existing restaurant in distance to apartment A or to apartment B.Hard8GeometrySorting+1No attempts yet5s128 MBJudgeable
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.Hard8Union-findSegment tree+2No attempts yet1s128 MBJudgeable
MetalCount how many simple monotone polygons use the given n points as vertices.Hard8Dynamic programmingGeometry+1No attempts yet1s128 MBJudgeable
Grid PanelGiven a panel with holes, find the smallest rectilinear convex region that covers every cell next to a hole plus one full row or column.Hard8GeometryBrute forceNo attempts yet1s128 MBJudgeable
Fire TowerPlace a vertical tower on a polygonal mountain chain and find the smallest height whose top sees every point above the terrain.Hard8GeometryBinary searchNo attempts yet1s128 MBJudgeable
Depth OrderGiven a pixel image of overlapping axis-aligned rectangles, decide whether it is realizable and report the possible depth range of one queried rectangle.Hard8Topological sortGraph+2No attempts yet1s128 MBJudgeable
Intelligent RobotsDecide whether a square robot moving only horizontally and vertically can leave the bounding rectangle of a rectilinear polygon without touching it.Hard8GeometryGraph+1No attempts yet1s128 MBJudgeable
PCBPlace two clocks and assign each of N points to one clock of capacity K to minimize the largest Manhattan distance from a point to its clock.Hard8GeometryBinary searchNo attempts yet1s128 MBJudgeable
CastlesFind the minimum Manhattan distance between any west-bank castle and any east-bank castle from two monotone chains.Hard8GeometrySorting+1No attempts yet1s128 MBJudgeable
StainsTaeyeon covers integer points off the x-axis with diamonds centered on the x-axis and minimizes the sum of their areas.Hard8Dynamic programmingGeometry+2No attempts yet1s128 MBJudgeable
Sewerage PlanningFind the line through the rectangle that maximizes the minimum distance to the given points.Hard8GeometryBinary searchNo attempts yet1s128 MBJudgeable
Straightening a bent wireDecide whether an axis-aligned wire can be straightened joint by joint from one end without ever touching itself during each unfolding.Hard8GeometrySimulationNo attempts yet1s128 MBJudgeable
Indisputable RightGiven antennas on a ridge of triangular mountains, find the fewest extra antennas on the ridge that connect all of them by line of sight.Hard8GeometryGraph+2No attempts yet1s128 MBJudgeable
The Avaricious ISPChoose two disjoint disks over weighted points to maximize the product of the covered weight sums.Hard8GeometrySorting+1No attempts yet1s128 MBJudgeable
GaragePlace the fewest axis-aligned w by h garages inside a W by H lot so no additional garage fits without moving them.Hard8GeometryMath+1No attempts yet2s256 MBJudgeable
Golf FieldChoose four of up to 30000 points in the plane so their convex hull has the largest possible area.Hard8GeometryTwo pointersNo attempts yet2s128 MBJudgeable
Janeway's JourneyFind the single straight line that hits the greatest number of disjoint circular asteroids in the plane.Hard8GeometrySorting+1No attempts yet40s128 MBJudgeable
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.Hard8GeometryMath+1No attempts yet5s128 MBJudgeable
Safari ParkTriangles are inserted one at a time and each query asks which earlier triangle strictly contains a point, reporting -1 on a boundary and 0 outside.Hard8GeometryTreeNo attempts yet5s128 MBJudgeable
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.Hard8GeometryIntervals+1No attempts yet1s128 MBJudgeable
Highway of the FutureGiven each car entry time and speed, compute the largest number of cars at the same spot at the same time on a 100-unit highway.Hard8GeometrySorting+2No attempts yet10s128 MBJudgeable
2D Solar SystemCircles tangent to one straight line glide with constant velocity, and the program reports when the first two touch.Hard8GeometrySorting+2No attempts yet1s128 MBJudgeable
Wedding HallFind the largest L-shaped hall of three equal squares that fits inside a walled garden without enclosing any tree.Hard8GeometryBinary search+2No attempts yet1s128 MBJudgeable
The MotorwayGiven sorted entry positions, find the smallest and largest even toll spacing that puts one entry between consecutive tolls, printed as reduced fractions.Hard8MathGeometry+1No attempts yet6s128 MBJudgeable
Rent-A-PixelCompute the smallest row- and column-convex block set containing the given blocks and print its outline corners clockwise.Hard8GeometryIntervals+1No attempts yet3s128 MBJudgeable
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.Hard8GeometrySimulation+1No attempts yet1s128 MBJudgeable
Sensor NetworkFind the largest group of sensors where every pair lies within distance d and print its size and members.Hard8BacktrackingGraph+1No attempts yet2s128 MBJudgeable
TribesRepeatedly merge axis-aligned rectangles whose overlap has positive area into their bounding box, then print the remaining boxes in lexicographic order.Hard8Union-findSegment tree+2No attempts yet3s1024 MBJudgeable
Super Mario 169Choose the switch order and the coin pickup routes in 3D so Mario collects every coin with the least total swim distance.Hard8Dynamic programmingGeometry+1No attempts yet3s256 MBJudgeable
Floor PaintingFind the side length of the largest axis-aligned square that fits inside a given orthogonal simple polygon.Hard8GeometryBinary searchNo attempts yet2s256 MBJudgeable
L∞ JumpsMake exactly n jumps of L-infinity length d from (0,0) to (s,t), minimizing total cost where each jump's direction is ranked from a given offset.Hard8Divide and conquerGeometry+2No attempts yet3s256 MBJudgeable
Shrine MaintenanceSplit the shrines on a circle of radius 1000 among W workers leaving from the center so the longest round trip is as short as possible.Hard8Dynamic programmingGeometry+1No attempts yet2s256 MBJudgeable
Watch, Man!Decide whether guards cover each art piece at its required level when segment and arc walls block sight lines.Hard8GraphGeometryNo attempts yet1s256 MBJudgeable
Galaxy collisionYou split the points into two groups whose internal distances exceed 5 and minimize the smaller group.Hard8GraphBFS+2No attempts yet3s256 MBJudgeable
MarblesPlace three pairwise disjoint axis-aligned rectangles to maximize red marbles in the first plus blue in the second plus green in the third.Hard8GeometryPrefix sum+1No attempts yet1s256 MBJudgeable
Mountainous landscapeFor each segment of a left-to-right polygonal chain, find the nearest later segment with a point strictly above the ray extending the segment.Hard8GeometryStackNo attempts yet10s256 MBJudgeable
Around the TrackFind the shortest closed route that stays between two nested polygons and winds once around the inner one.Hard8GeometryShortest path+1No attempts yet2s256 MBJudgeable
ContainmentYou pick a set of grid cells covering all failing cells so the number of boundary faces is as small as possible.Hard8GraphGeometryNo attempts yet20s256 MBJudgeable
Damage AssessmentCompute the remaining gasoline volume in a tilted cylindrical tank with spherical caps from the tilt and liquid level.Hard8GeometryMathNo attempts yet1s256 MBJudgeable
Line Fitting Under UncertaintyFind the line that minimizes the worst expected absolute deviation from uncertain sample values and print that error.Hard8Binary searchGeometry+1No attempts yet2s256 MBJudgeable
Polygon GuardsPlace the fewest guards on vertices of an orthogonal simple polygon with under 40 vertices so every vertex is visible from a guard.Hard8GeometryBrute force+2No attempts yet5s128 MBJudgeable
Molecule Pair Distance HistogramFrom molecule counts on an N by N grid, find the mean pairwise Euclidean distance and the count of pairs at each squared distance.Hard8Divide and conquerMatrix+2No attempts yet10s512 MBJudgeable
Fallen Apples and the Nearest TreeFor each yearly apple drop on a grid, output the squared Euclidean distance to the nearest existing tree, counting the new tree only from the next year.Hard8GeometryDynamic programming+2No attempts yet2s128 MBJudgeable
PutterCount the orders in which a single bouncing shot from inside a convex polygon can hit each wall exactly once.Hard8GeometryBrute forceNo attempts yet8s512 MBJudgeable
Fire Truck DispatchFind the shortest drive along roads from any station to a point within hose radius R of each fire, printing -1 when no such point can be reached.Hard8Shortest pathGeometry+1No attempts yet15s256 MBJudgeable
Fencing the HerdThe herd grows over time and each query asks whether every cow so far lies strictly on one side of the given line.Hard8GeometryBinary searchNo attempts yet2s256 MBJudgeable
AsteroidsFind the positive time when two steadily moving convex polygons share their largest overlap area, or report the first touch or never.Hard8GeometryMathNo attempts yet2s256 MBJudgeable
Hexagon travelCount the orders of L left turns, R right turns and M moves that leave a hex-grid robot on a red, green, or blue tile, modulo 1,000,000,007.Hard8Dynamic programmingCombinatorics+2No attempts yet2s32 MBJudgeable
CrowSum the shortest path lengths between consecutive query points that stay above the ground and outside a polygonal mountain.Hard8GeometryShortest path+1No attempts yet3s256 MBJudgeable
Complex Paper FoldingTry every vertex-to-vertex fold of a convex polygon and report the perimeter of the result with the most vertices.Hard8GeometryBrute forceNo attempts yet1s256 MBJudgeable
Proud PenguinDistribute at most W units of water into level pools along a polygonal track to minimize the tallest uphill stretch penguins must climb.Hard8Binary searchGreedy+1No attempts yet3s256 MBJudgeable
Shibuya CrossingGiven the list of crossing path pairs, find the size of the largest group of people whose paths all cross each other.Hard8GraphDynamic programming+1No attempts yet1s256 MBJudgeable
Area of EffectPick a circle of radius at most r that avoids the interiors of the village circles and covers as many minion points as possible.Hard8GeometryBrute forceNo attempts yet5s256 MBJudgeable
Stacked Colored PaperAfter gluing up to 200 triangles and circles in order, print each sheet's visible area after every prefix of the stack.Hard8GeometryMathNo attempts yet1s512 MBJudgeable
Visitors' TrainCompute the total length of a straight track segment from which the main rectangle stays fully visible behind other rectangles.Hard8GeometryIntervalsNo attempts yet1s256 MBJudgeable
Kingdom TripFind the shortest subsequence from the first to the last point so every skipped point lies within distance d of its shortcut segment.Hard8Dynamic programmingGeometryNo attempts yet2s256 MBJudgeable
Path Inside a HistogramCompute the sum of shortest inside-polygon distances from the base vertex to many boundary points in a rectilinear histogram.Hard8GeometryShortest pathNo attempts yet2s256 MBJudgeable
Pyramid BaseFind the side length of the largest axis-aligned square on a grid that avoids all given rectangular obstacles.Hard8Binary searchGeometry+2No attempts yet5s128 MBJudgeable
Flight Plan EvaluationGiven continent polygons and flight waypoints on a sphere, compute the total flight length and the share flown over water.Hard8GeometryMathNo attempts yet6s256 MBJudgeable
Hole in OneFind the most walls a ball shot from the origin can destroy by bouncing off axis-aligned walls before dropping into the hole.Hard8BacktrackingGeometry+1No attempts yet5s256 MBJudgeable
MidpointCount the triples (i, j, k) from three collinear point sets in which C_k is the midpoint of A_i and B_j.Hard8GeometryMath+1No attempts yet10s256 MBJudgeable
HypercubeDecide whether a tree-like polycube of eight cubes folds along shared faces into the surface of a four-dimensional hypercube.Hard8BacktrackingGeometryNo attempts yet1s256 MBJudgeable
Sunlight on a TreeReport all nodes on the tree path from u to v whose dot product with the query direction is minimal.Hard8TreeSegment tree+1No attempts yet5s256 MBJudgeable
Stop Making SenseFor each input point in turn, remove it and report the area of the smallest convex polygon enclosing the rest.Hard8GeometrySorting+1No attempts yet1s256 MBJudgeable
Rain AgainFind the fewest leading drops so every W by H rectangle inside the L by L pot contains a drop strictly inside, or report -1.Hard8Binary searchSegment tree+1No attempts yet2s256 MBJudgeable
Mowing the FieldCount interior crossings of perpendicular mower segments cut at least T days apart.Hard8Segment treeGeometry+1No attempts yet5s512 MBJudgeable
FaultGiven diagonal fault shifts with surface erosion, report the original depth of the layer exposed at each unit of the surface.Hard8Segment treeGeometryNo attempts yet2s256 MBJudgeable
Don't Break the Nile (Large)Compute the maximum unit flow from the south edge to the north edge of a grid blocked by up to 1000 rectangles.Hard8Shortest pathGraph+1No attempts yet5s512 MBJudgeable
Xeno-archaeology (Large)From tile positions and colors in infinite alternating square rings, find the fitting center nearest the origin or report the tiles as too damaged.Hard8MathGeometry+1No attempts yet5s512 MBJudgeable
The peak that looks highestGiven each peak's apparent-highest peak ahead, assign integer heights matching all sightings and print the lexicographically smallest heights or Impossible.Hard8GeometryBacktracking+1No attempts yet5s512 MBJudgeable
Hall of MirrorsCount the directions from the center of a mirrored grid room in which a ray returns to the viewer within distance D under the given reflection rules.Hard8GeometrySimulationNo attempts yet5s512 MBJudgeable
Hall of Mirrors (Large)Count the directions in which a ray from your cell returns to its exact center after mirror reflections within distance D.Hard8GeometrySimulation+1No attempts yet5s512 MBJudgeable
Ninjutsu (Small)Cut the rope to any length up to R so the counterclockwise swing bends around the maximum number of point targets.Hard8GeometryBacktrackingNo attempts yet5s512 MBJudgeable
Grazing GoatsFor each candidate bucket point, fix each rope at its pole distance and compute the area shared by all disks.Hard8GeometryNo attempts yet5s512 MBJudgeable
Minimum Triangle PerimeterGiven up to 10000 points, find three whose triangle has the smallest total perimeter, with collinear triples allowed.Hard8GeometryDivide and conquer+1No attempts yet5s512 MBJudgeable
Minimum Triangle PerimeterGiven up to a million integer points, pick three that form the triangle of smallest perimeter and report that perimeter.Hard8GeometryDivide and conquer+1No attempts yet90s512 MBJudgeable
Two Lights in a Square RoomGiven two point lights and up to 50 circular pillars inside a square, find the area lit by neither, by red only, by green only, and by both.Hard8GeometryImplementation+2No attempts yet40s512 MBJudgeable
Watering PlantsGiven N disjoint disks, find the smallest radius R such that two disks of radius R can cover all the plants.Hard8GeometryBinary search+2No attempts yet5s512 MBJudgeable
How Big Are the Pockets? (Large)A run-length-encoded turtle walk traces a simple closed lattice polygon; compute the total area of all points outside it that have boundary both east and west or both north and south.Hard8GeometrySimulation+2No attempts yet5s512 MBJudgeable
Minimum transmitter powerPlace a flagship in 3D so the maximum weighted Manhattan distance to N ships is minimized, and report that minimum power rounded to six decimals.Hard8GeometryBinary search+2No attempts yet5s512 MBJudgeable
Fly Swatter (Small)Compute the probability that a randomly placed fly disk touches a circular ring crossed by a grid of cylindrical strings, and print it to six decimals.Hard8GeometryMath+2No attempts yet5s512 MBJudgeable
Fly Swatter (Large)Given the racquet geometry, compute the probability that a fly of radius f, centered uniformly in the outer circle, overlaps the ring or any string.Hard8GeometryMath+2No attempts yet20s512 MBJudgeable
Half-plane land grabLines are added one at a time, and after each addition you must report the maximum y value over all added lines at a given x.Hard8GeometryDynamic programming+1No attempts yet2s128 MBJudgeable
Relay SignalCount boats reachable within one relay hop from boat 1, where visibility means the connecting segment never enters the convex island interior; every coordinate is a lattice point.Hard8GeometrySorting+2No attempts yet2s512 MBJudgeable
Red segments and blue segmentsColor N points red or blue, then draw non-crossing same-color segments so that no red and blue segment touch; maximize total segment scores.Hard8Dynamic programmingGeometry+2No attempts yet2s512 MBJudgeable
Run and Swim RaceGiven each runner's running and swimming speeds, find every participant who can finish first for some positive choice of the leg lengths R and S.Hard8GeometrySorting+2No attempts yet2s512 MBJudgeable
Polygon GameTwo players alternately draw chords inside a convex N-gon that avoid all earlier chords, including shared endpoints; decide the winner under optimal play.Hard8Game theoryCombinatorics+2No attempts yet2s512 MBJudgeable
SymmetryGiven up to 1000 distinct lattice points, find the minimum number of extra points needed to make the set symmetric about some point or some line.Hard8GeometryHash map+2No attempts yet5s512 MBJudgeable
FenceGiven points on grid corners, find the shortest closed fence along cell edges and diagonals that encloses all of them, output as a + b*sqrt(2).Hard8GeometrySorting+1No attempts yet2s512 MBJudgeable
Shortest BridgeGiven two polygonal riverbanks and points s and t on opposite sides, minimize the bridge length between the banks, then the road lengths from s and t to its endpoints.Hard8GeometryBrute force+2No attempts yet5s512 MBJudgeable
Square in CirclesGiven overlapping circles centered on the x-axis, find the side length of the largest axis-aligned square that fits inside their union.Hard8GeometryBinary searchNo attempts yet8s512 MBJudgeable
Color the Map ExtremeGiven simple polygons for each country, decide adjacency when borders share a positive-length segment, then find the chromatic number of the adjacency graph.Hard8GeometryGraph+1No attempts yet8s512 MBJudgeable