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
Rancher Seunghwan Baek's GiftGiven a convex quadrilateral, compute five sub-region areas formed by connecting vertices to midpoints of the opposite sides plus the perimeter of the central quadrilateral, using geometry formulas.Medium6GeometryImplementation+1No attempts yet1s128 MBJudgeable
Lattice Point Convex HullCompute the convex hull of up to 50 lattice points and print its vertices starting from the topmost-leftmost point in clockwise order.Medium6GeometrySorting+1No attempts yet1s128 MBJudgeable
Model Rocket HeightGiven angle measurements from two observers with fixed geometry, compute the rocket's smoke-point height using 3D line intersection, or flag disqualification or measurement error based on given thresholds.Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
Model Rocket LaunchGiven two observers' 3D lines of sight (from elevation and azimuth angles plus fixed instrument heights and baseline geometry), compute the midpoint of the closest points between the two skew lines and output the rocket's height above the launch pad for each of N launches.Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
Center of the Outer TrianglesGiven a triangle, construct outward squares on each side, form outer triangles, and compute the common intersection point of three specific medians (Vecten point).Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
XOR ShapesGiven up to 10 right isosceles triangles drawn with XOR-style color inversion, compute the total black area after all draws.Medium6GeometryBit manipulation+1No attempts yet1s128 MBJudgeable
BiologistSimulate N bacteria moving in fixed grid directions and find the earliest time when the maximum overlap count occurs at one cell.Medium6MathSimulation+1No attempts yet1s128 MBJudgeable
CabbageCompute the total roof area covered by N unit-radius circles clipped to a rectangle, allowing overlaps to be counted once.Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
Ant TownGiven up to 10 umbrella points on an H by V Manhattan grid, count intersections tied for minimum Manhattan distance to two or more umbrellas.Medium6MathGeometry+2No attempts yet1s128 MBJudgeable
Map LabelsGiven N points as top-left corners of fixed-ratio (3:1 width to height) axis-aligned rectangles, find the maximum height so no two rectangles overlap, using binary search on height and an overlap check.Medium6Binary searchSorting+1No attempts yet4s128 MBJudgeable
Pizza DeliveryChoose at most K of M candidate sites to maximize the total population within radius R, counting each building once even if covered multiple times.Medium6CombinatoricsBrute force+1No attempts yet1s128 MBJudgeable
Maximum Vector SumSelect a subset of up to 30000 2D vectors so that the squared length of their sum is maximized, answer fits in 64-bit.Medium6GreedySorting+1No attempts yet1s128 MBJudgeable
Closing WindowsSimulate closing overlapping windows in order to determine the minimum clicks needed to close the very first opened window whose top-right cell must become visible.Medium6SimulationGeometry+1No attempts yet1s128 MBJudgeable
PhotographsFind the minimum number of fixed-area rectangles anchored on the x-axis needed to cover all given stars.Medium6GreedyGeometry+1No attempts yet1s128 MBJudgeable
Mars MapCompute the total area covered by the union of up to 10,000 axis-aligned rectangles.Medium6Segment treeSorting+1No attempts yet1s128 MBJudgeable
Rectilinear PolygonReconstruct a simple rectilinear polygon's edges from its vertices given in random order and output each edge's compass direction in clockwise order.Medium6GeometrySorting+1No attempts yet1s128 MBJudgeable
Equipment BoxDetermine whether a rectangular box of given dimensions can be rotated and placed strictly inside a rectangular tile of given dimensions without touching its border.Medium6GeometryBinary search+1No attempts yet1s128 MBJudgeable
Kingdom PartitioningSimulate a sweep of vertical lines where each remaining kingdom's threshold crossing position is found via circle-area integration and the smallest threshold is served each round.Medium6GeometrySimulation+1No attempts yet2s128 MBJudgeable
AstronomyGiven orbital periods of n planets moving on circular orbits, compute the exact fractional time interval between consecutive moments all planets and the star are collinear.Medium6MathNumber theory+1No attempts yet2s128 MBJudgeable
RFID TrackingGiven sensors, walls, and items on a plane, find for each item all sensors whose distance minus the number of walls crossed is within range r, then print them sorted by coordinates.Medium6GeometrySimulation+1No attempts yet3s128 MBJudgeable
FractalGiven a recursively self-similar fractal built from a base polyline, find the point at a given fraction of its total arc length after d recursive refinements.Medium6RecursionGeometry+1No attempts yet1s128 MBJudgeable
Settlers of CatanSimulate filling hexagonal tiles in an outward spiral with resource-choice rules and report the resource of the n-th tile.Medium6SimulationImplementation+1No attempts yet1s128 MBJudgeable
Lineland's AirportFind the position of a length-L window along a piecewise-linear terrain profile that minimizes the area above the flat strip that must be excavated.Medium6GeometryBinary search+1No attempts yet2s128 MBJudgeable
Convex Regular PolygonGiven three vertices of some convex regular polygon, compute the minimum number of sides that polygon could have.Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
SlalomGiven a start point and a sequence of horizontal gates at decreasing heights, find the minimum-length path from the start that passes through each gate segment in order.Medium6GeometryGreedy+1No attempts yet1s128 MBJudgeable
Point SeparationDecide if two colored point sets on a plane can be separated by a straight line, essentially checking convex hull separation.Medium6GeometryMathNo attempts yet1s128 MBJudgeable
Malfatti CirclesGiven triangle vertices, compute the radii of the three classical Malfatti circles using the known closed-form formula.Medium6MathGeometry+1No attempts yet1s128 MBJudgeable
Spherical MirrorsSimulate a laser reflecting off multiple spheres in 3D using mirror-reflection geometry and report the final reflection point.Medium6GeometrySimulation+1No attempts yet1s128 MBJudgeable
Color the MapGiven polygons grouped into named countries, determine the minimum colors needed so adjacent countries (sharing a border segment of positive length) differ, using geometric segment overlap detection to build the adjacency graph then graph coloring.Medium6GeometryGraph+1No attempts yet1s128 MBJudgeable
Monster TrapGiven up to 100 line segments around the origin, decide whether they form a closed barrier that completely encloses the origin with no gap for the monster to escape through.Medium6GeometryGraph+1No attempts yet1s128 MBJudgeable
Ski JumpGiven a piecewise hill profile and a take-off parabola, find where the jump lands and report the landing distance, speed, and angle from the hill tangent.Medium6Binary searchMath+2No attempts yet2s128 MBJudgeable
Safe ZoneGiven disjoint circles, find the shortest closed fence enclosing all of them, which equals the convex hull perimeter plus the circumference of one circle.Medium6GeometryDivide and conquerNo attempts yet1s128 MBJudgeable
Suiting WeaversGiven each weaver's circular territory and each fiber pile, decide whether Willy can end up with at least as many fibers as every rival under any assignment of piles to reachable weavers.Medium6GreedySorting+2No attempts yet1s128 MBJudgeable
Screen SaverGiven a piecewise linear floor and a water level, update floor heights or the level and report the submerged area to three decimals.Medium6GeometrySegment tree+1No attempts yet2s128 MBJudgeable
Town SquareGiven four statue points, find the side length of the largest square whose four sides each sit exactly 5 feet from one distinct statue.Medium6GeometryBrute force+2No attempts yet1s128 MBJudgeable
Photo ShootGiven Adam's position, each person's angle around him, and a fixed camera width, find the fewest photos that cover every person.Medium6SortingGreedy+2No attempts yet1s128 MBJudgeable
Vampires!For each vampire, find the directions along which a mirror's reflecting side sees it with no mortal or mirror blocking the line.Medium6SimulationImplementation+2No attempts yet1s128 MBJudgeable
Swamp ThingsFor each test case, count how many of up to 1000 points lie on a single line chosen as the one containing the most points, but only if that maximum count is at least four.Medium6GeometryHash map+2No attempts yet1s128 MBJudgeable
Sunday DriveGiven a sequence of straight and 90-degree curved highway sections with M lanes, find the shortest path including lane changes, which take 100 feet per lane.Medium6Dynamic programmingGeometryNo attempts yet1s128 MBJudgeable
Robot ChallengeThe robot starts at (0,0), must visit targets in order, and may skip any target by paying its penalty. Find the minimum total time plus penalties to reach (100,100).Medium6Dynamic programmingGeometry+2No attempts yet1s128 MBJudgeable
A Walk in the ParkGiven points for trees and infinite horizontal or vertical paths that avoid all trees, count trees visible along a perpendicular direction with no other tree blocking the sight line.Medium6SortingHash map+2No attempts yet2s128 MBJudgeable
PaintballDecide whether a path can cross a 1000x1000 field from west edge to east edge while avoiding circular firing ranges, and give the northernmost entry and exit points.Medium6GeometryUnion-find+2No attempts yet1s128 MBJudgeable
CranesChoose a subset of at most 15 crane locations, each with a radius, so that every pair's distance exceeds the sum of radii, maximizing the total squared radius.Medium6Brute forceGeometry+2No attempts yet1s128 MBJudgeable
BalanceGiven the polygon outline of a boat's side view, compute the centroid above and below the waterline and report whether the Center of Effort is forward, aft, or balanced, with the difference rounded to two decimals.Medium6GeometryMath+2No attempts yet1s128 MBJudgeable
Water Main Break, FixedA crew starts at the origin and must visit up to 10 breaks in some order; pick the order that minimizes total water lost, where each break waits until its start time.Medium6Brute forceGreedy+2No attempts yet8s128 MBJudgeable
Slots of FunGiven letters on a triangular lattice, find every letter whose three positions form an equilateral triangle.Medium6GeometryBrute force+2No attempts yet1s128 MBJudgeable
Expanding RodsGiven a heated rod fixed at both ends, compute how far its midpoint bows out, using the circular-segment geometry and binary search.Medium6Binary searchGeometry+1No attempts yet1s128 MBJudgeable
BiometricsGiven two polygons with vertices in matching feature order, decide whether one maps onto the other by translation, rotation, and uniform scaling without reflection.Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
A Star, Not a Tree?Given up to 100 points in the plane, pick one hub location that minimizes the sum of Euclidean distances to all points, and report the rounded minimum.Medium6GeometryMath+2No attempts yet1s128 MBJudgeable
Gopher IIEach gopher escapes if some hole within s*v metres is assigned to it, one gopher per hole; minimize the number of gophers left out by finding a maximum matching.Medium6GraphUnion-find+2No attempts yet1s128 MBJudgeable
SaskatchewanGiven a polygon with integer vertices, count how many unit grid squares lie entirely inside the polygon.Medium6GeometryMathNo attempts yet1s128 MBJudgeable
SnakesDecide whether a path exists from the west edge to the east edge of a 1000 by 1000 square while staying at distance at least r from every snake.Medium6GeometryUnion-find+1No attempts yet1s128 MBJudgeable
BilliardGiven table dimensions, travel time, and bounce counts off the vertical and horizontal sides, find the launch angle and initial speed of a ball starting at the center and returning to it.Medium6MathGeometry+2No attempts yet1s128 MBJudgeable
Cables ... in Spaaace!Given a planet's diameter and up to 100 city coordinates, compute the minimum cable length of a strongly connected network and compare it to the available length L.Medium6GraphMinimum spanning tree+2No attempts yet1s128 MBJudgeable
Any Way You Slice ItSimulate a laser cutter's path from turn and move instructions and report the first move that crosses an earlier cut segment, forming a hole.Medium6GeometrySimulation+2No attempts yet1s128 MBJudgeable
Bulletin BoardGiven up to 100 axis-aligned rectangles on a board, report the uncovered area, the maximum overlap depth, and the area covered at exactly that depth.Medium6GeometrySorting+2No attempts yet1s128 MBJudgeable
Go Go GoreliansBuild the network by linking each new planet to the nearest existing planet, then find the planet or two adjacent planets that minimize the maximum distance to all others.Medium6GraphTree+2No attempts yet1s128 MBJudgeable
WIMP: A Window Manager ProgramSimulate a window manager over a 1024x1024 screen, tracking overlapping windows and handling click, drag, zoom, close, create, and redraw events.Medium6SimulationImplementation+2No attempts yet1s128 MBJudgeable
TsunamiPlace a warning center and connect cities with cables so every city reaches the center, no city is warned from a city farther from the shore, and total cable length is minimized.Medium6GraphMinimum spanning tree+2No attempts yet1s128 MBJudgeable
Spy CamGiven a labeled pixel grid of axis-aligned overlapping rectangles, decide for each label whether the whole sheet is provably fully visible or may be partly hidden.Medium6GeometryImplementation+2No attempts yet1s128 MBJudgeable
Extended Manhattan DistanceGiven an axis-aligned city grid and two integer points, find the shortest path length when travel inside the grid is restricted to axis-parallel streets and travel outside is free in any direction.Medium6GeometryMath+2No attempts yet1s128 MBJudgeable
Gypsy MothsGiven tree directions from a fixed camera and a fixed angular width, find the tenth-of-a-degree angle centered on the most trees, counting only trees strictly inside the view.Medium6Two pointersSorting+2No attempts yet1s128 MBJudgeable
A Baron LandscapePlace a castle first on a grid; a rival then picks a legal square to minimize your tax advantage, and you maximize that worst case. Report the guaranteed advantage.Medium6Brute forceGeometry+2No attempts yet1s128 MBJudgeable
In Defence of a GardenGiven a fence drawn as an axis-aligned walk on a 100x100 grid, count the total area of cells fully enclosed by the fence.Medium6GeometryBFS+2No attempts yet1s128 MBJudgeable
CoverageGiven up to 100 towers with integer centers and radii, compute the percentage of a line segment path covered by at least one tower, rounded to two decimals.Medium6GeometryIntervals+2No attempts yet1s128 MBJudgeable
WaxDivide a rectangular room into equal-area connected pieces by drawing lines from the door to the walls, and print each segment endpoint.Medium6GeometryMath+2No attempts yet3s128 MBJudgeable
Server RelocationFind the minimum number of plug-ins needed to move a server between two outlets, where each move must stay within reach of a cord from an outlet.Medium6GraphBFS+2No attempts yet1s128 MBJudgeable
TOYSGiven n nonintersecting partitions splitting a box into n+1 bins, count how many of m dropped toys land in each bin.Medium6Binary searchGeometry+1No attempts yet1s128 MBJudgeable
Earth Observation with a Mobile Robot TeamSimulate robots moving on piecewise-linear paths and report which ones receive the first robot's data through wireless contact over time.Medium6SimulationGraph+2No attempts yet1s128 MBJudgeable
Moving the TreesGiven N trees on the left side of a road of length L and width W, find the minimum total Euclidean distance to move them so that each side holds N/2 trees at identical equally spaced positions.Medium6MathSorting+2No attempts yet1s128 MBJudgeable
Adjacent EdgesRead several triangle meshes, label distinct vertices by first appearance, and for each triangle report the opposite vertex of the triangle sharing each of its three edges, or X when none exists.Medium6Hash mapGeometry+2No attempts yet1s128 MBJudgeable
Pizza!Given nuggets at polar positions on a unit circle, find the maximum number of equal-angle radial slices so every slice holds the same nugget count.Medium6MathNumber theory+2No attempts yet1s128 MBJudgeable
Warehouse Location PlanningChoose any nonempty subset of up to 20 candidate warehouses and assign each of up to 100 stores to a chosen one so that building plus Euclidean shipping cost is minimum.Medium6Brute forceBit manipulation+2No attempts yet2s128 MBJudgeable
Fractal DistanceGiven the order of two houses along an n-th Hilbert curve, compute the straight-line distance between their grid positions.Medium6Divide and conquerRecursion+2No attempts yet1s128 MBJudgeable
Cell Phone AntennaPlace one antenna of range 1000 on the line y=0 so that the total inhabitants of all covered houses is maximized, and report that maximum.Medium6GeometryIntervals+2No attempts yet1s128 MBJudgeable
Starry NightFind 8-connected star clusters in a grid and assign the same letter to clusters that match under rotation and reflection.Medium6DFSMatrix+2No attempts yet1s128 MBJudgeable
Walking Santa ClausPlace a depot on a huge grid so that twice the sum of Manhattan distances to all houses, minus the farthest one, is minimized, and print the best cell.Medium6MathGeometry+2No attempts yet1s128 MBJudgeable
The Oldest RuinsGiven up to 3000 integer points, find four that form a square of the largest area and output that area, or 0 if none exist.Medium6GeometryHash map+2No attempts yet1s128 MBJudgeable
Isosceles TrianglesGiven N integer points with no three collinear, count the triples that form an isosceles triangle.Medium6GeometryHash map+2No attempts yet2s128 MBJudgeable
Will Indiana Jones Get There?Given axis-aligned wall segments, find the smallest board length such that a path from the first wall to the second keeps every gap no larger than that length.Medium6GraphUnion-find+2No attempts yet1s128 MBJudgeable
Bovine BalletSimulate a cow's dance of foot moves and 90-degree pivots, track every foot cell over time, and report the smallest bounding rectangle or -1 if two feet ever collide.Medium6SimulationImplementation+1No attempts yet1s128 MBJudgeable
Farm PaintingGiven up to 50,000 non-intersecting axis-aligned rectangles, count how many are not contained inside any other rectangle.Medium6SortingArray+2No attempts yet1s128 MBJudgeable
Perimeter of the Hay BalesGiven up to 50000 grid cells forming one connected region, find the outer perimeter, ignoring any enclosed holes.Medium6GraphBFS+2No attempts yet1s128 MBJudgeable
Crazy FencesGiven horizontal and vertical fences that meet only at endpoints and points for cows, find the largest set of cows that can reach each other without touching a fence.Medium6GeometryGraph+2No attempts yet1s128 MBJudgeable
Connect the CowsCount the axis-parallel tours from the origin that turn exactly once at each of N (at most 10) given cow positions before returning to the origin.Medium6BacktrackingGeometry+2No attempts yet1s128 MBJudgeable
SymmetryGiven N distinct points in the plane, count how many lines reflect the whole set onto itself.Medium6GeometryHash map+2No attempts yet1s128 MBJudgeable
Lucky CharmsGiven a bracelet of length L nailed at position N, with charms at positions P_i hanging on strings of length S_i, compute how far below the nail each charm droops.Medium6GeometryImplementation+2No attempts yet1s128 MBJudgeable
Claustrophobic CowsGiven up to 2000 points, find the unique pair with the smallest Euclidean distance and print their ids in increasing order.Medium6GeometryDivide and conquer+2No attempts yet1s128 MBJudgeable
Building the MoatGiven N distinct points with no three collinear, compute the perimeter of their convex hull and print it to two decimal places.Medium6GeometrySorting+2No attempts yet1s128 MBJudgeable
Big SquarePlace one extra 'J' on an empty cell of an N by N grid so that the four corners of some 'J' square have the largest possible area.Medium6GeometryBrute force+2No attempts yet1s128 MBJudgeable
ReflectionsGiven disjoint 2D mirror spheres and a ray, trace up to ten reflections and report which spheres the ray hits.Medium6GeometrySimulation+2No attempts yet1s128 MBJudgeable
Laser LinesFor each coordinate set, find every straight line through three or more points and print the collinear points in sorted order.Medium6GeometryHash map+1No attempts yet1s128 MBJudgeable
IntersectionDecide, for each test case, whether a line segment and an axis-aligned rectangle share at least one point, including degenerate rectangles.Medium6GeometryImplementation+2No attempts yet1s128 MBJudgeable
PostScript EmulationSimulate a subset of PostScript transforms (rotate, translate, scale) and rewrite each drawing command as absolute coordinates in the original system.Medium6SimulationGeometry+2No attempts yet1s128 MBJudgeable
CylinderGiven a w by h sheet, cut it into two pieces, make a circle base from one and roll the other into the side, and maximize the cylinder volume.Medium6GeometryMath+1No attempts yet1s128 MBJudgeable
Decorate the WallGiven non-overlapping axis-aligned rectangles on a wall, find the lowest then leftmost position where a new w' by h' rectangle fits without overlapping any of them, or report failure.Medium6GeometrySorting+2No attempts yet1s128 MBJudgeable
Arable AreaGiven a lattice polygon, count the unit grid squares fully contained inside it.Medium6GeometryMath+2No attempts yet1s128 MBJudgeable
CraneGiven a chain of segments with one joint angle changing per command, report the endpoint coordinates after each change within 0.02 and to two decimals.Medium6GeometryMath+2No attempts yet1s128 MBJudgeable
Rectangle CuttingGiven a small cake and several rectangular outlines cut into it, count the number of connected pieces the cake is divided into.Medium6BFSImplementation+2No attempts yet1s128 MBJudgeable
Parallelogram CountingGiven n points, count how many 4-point subsets form a parallelogram by pairing points that share a midpoint.Medium6Hash mapGeometry+2No attempts yet1s128 MBJudgeable