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
Xeno-archaeology (Small)Given colored tiles from an infinite square ring pattern, find the pattern center that fits all tiles with the stated tie breaks.Medium6Brute forceMath+1No attempts yet5s512 MBJudgeable
Shoot the Target (Small1)Given a slanted segment above the x-axis, find the point on the x-axis that sees the segment under the largest angle and print that angle in degrees.Medium6GeometryMathNo attempts yet5s512 MBJudgeable
Shoot the TargetPick the ground point on the x-axis that makes the given segment look widest and output that largest angle in degrees.Medium6GeometryMathNo attempts yet5s512 MBJudgeable
Sunlight Hours (Small)Compute the share of building height that gets at least H hours of direct sun as the sun travels a semicircular path past blocking buildings.Medium6GeometryBinary searchNo attempts yet5s512 MBJudgeable
Antenna repair (Large)Arrange the given rod lengths on equally spaced rays around one point to maximize the sum of neighboring triangle areas.Medium6CombinatoricsSorting+2No attempts yet5s512 MBJudgeable
Center of Mass of a Firefly SwarmEach firefly moves linearly at constant velocity; find the minimum distance from the origin to the swarm's center of mass over t >= 0 and the earliest time it occurs, printed to eight exact decimals.Medium6MathGeometry+2No attempts yet5s512 MBJudgeable
Triangle TransformationGiven two triangles where the second lies inside the first, find the fixed point of the rotation, scaling, and translation map taking one to the other.Medium6GeometryMath+1No attempts yet5s512 MBJudgeable
Triangle AreasGiven N, M, A, find three lattice points in an N by M grid forming a triangle of area exactly A/2, printing the lexicographically smallest coordinate sequence or IMPOSSIBLE.Medium6GeometryMath+2No attempts yet5s512 MBJudgeable
Mixture (Small)Find the amounts of two mixtures a and b maximizing revenue under shared material limits, then round the optimum to two decimals.Medium6GeometryBrute force+2No attempts yet1s256 MBJudgeable
Gennady is smartMaintain counts on a hexagonal grid; each update adds 1 to all cells within distance r of (x, y), and queries ask for a single cell's value.Medium6Prefix sumMatrix+1No attempts yet2s256 MBJudgeable
New TreeGiven point A and a new tree, find the smallest pair (B, C) so triangle ABC is counterclockwise, contains the new tree strictly, and contains no other old tree.Medium6GeometryBrute forceNo attempts yet0.2s1024 MBJudgeable
Tidying upPlace N points so the configuration is symmetric about the y-axis with equal multiplicities; minimize the total Euclidean distance moved.Medium6GeometryGreedy+2No attempts yet2s512 MBJudgeable
Stock ChartsGiven N piecewise-linear price graphs over K time points, find the minimum number of charts so that no two graphs on a chart intersect.Medium6GeometryIntervals+1No attempts yet2s512 MBJudgeable
Points and LinesParse an expression of points and lines joined by @, evaluate geometric operations, and print the resulting point rounded to 8 decimals.Medium6ImplementationMath+1No attempts yet8s512 MBJudgeable
Pizza PlacementPlace circles tangent to two legs of a right triangle without overlapping earlier ones; report the area of the k-th largest.Medium6GeometryMath+1No attempts yet1s256 MBJudgeable
Unusual DartsGiven seven dart positions forming a simple polygon in some unknown order and the win probability of a random three-dart throw, find the dart order that matches it.Medium6GeometryBrute force+1No attempts yet2s512 MBJudgeable
Obstacle Course RunGiven vertical wall segments, find the shortest eastbound route from a start point to a finish line and list the y coordinates of all distinct endpoints of shortest routes.Medium6GeometryGraph+2No attempts yet2s512 MBJudgeable
The sun goes down...Given up to 100000 distinct points in the plane, decide whether two straight lines can cover all of them.Medium6GeometryBrute force+2No attempts yet5s512 MBJudgeable
Circles tangent to a lineArrange N given circles on one side of a line, each touching it, without interiors overlapping, and minimize the span between the leftmost and rightmost touch points.Medium6Brute forceGeometry+1No attempts yet2s512 MBJudgeable
Robert FloydStitches walks up to 2048 unit steps on a huge grid, leaving bile on each edge crossed, and you must count the regions the bile walls split the map into.Medium6GeometrySimulation+1No attempts yet1.2s256 MBJudgeable
Manhattan Positioning SystemGiven beacons with known grid positions and Manhattan distances to an unknown receiver, decide whether the receiver position is unique, ambiguous, or impossible.Medium6GeometryMath+1No attempts yet2s512 MBJudgeable
DolphinsSimulate fish that swim one unit away from a dolphin each step, and count how many trajectories hit the net polygon.Medium6GeometrySimulation+2No attempts yet2s512 MBJudgeable
Spheres and queriesGiven N points in 3D and M spheres, answer for each sphere how many points lie inside it, counting boundary points.Medium6GeometrySorting+2No attempts yet20s512 MBJudgeable
Martian VolleyballGiven an axis-parallel polygon, find the minimum number of points outside the court such that every side has a point on its supporting line.Medium6GeometryGraph+2No attempts yet1s512 MBJudgeable
Incident in AtlantisGiven line-segment walls, up to 50 booths, and a teleport budget T, find the shortest walk from start to portal where teleports happen only between booths with an unobstructed segment.Medium6GeometryShortest path+2No attempts yet2s512 MBJudgeable
Lightning StrikeFor each test case, compute the area of a circle cut by an infinite wedge with a given apex, direction, and spread angle.Medium6GeometryMath+1No attempts yet2s512 MBJudgeable
Cell phone towersGiven up to 40 house coordinates, find the smallest common radius so that two circles of that radius can cover every house.Medium6GeometryBinary search+1No attempts yet2s512 MBJudgeable
Friends or Enemies?For each query number pair, find the points on a clockwise square spiral, then check whether they lie on the same side of a given line.Medium6GeometryMath+1No attempts yet2s512 MBJudgeable
Circle Containing All PointsGiven N points, find the diameter of the smallest enclosing circle, printed to two decimals.Medium6GeometryBrute forceNo attempts yet2s512 MBJudgeable
Construction ToyGiven up to nine distinct segment lengths, find the largest possible distance from a wall reachable by gluing triangles onto an initial base segment.Medium6GeometryBacktracking+1No attempts yet2s512 MBJudgeable
Windy PathGiven N points and a string of L/R turns, build the non-crossing path by repeatedly picking the unused point that is extreme (leftmost or rightmost) relative to the last point.Medium6GeometryGreedy+2No attempts yet2s512 MBJudgeable
Robot Arm Inverse KinematicsGiven segment lengths and a target hand position for a robot arm with equal joint angles, recover the base angle and joint angle that reach it.Medium6GeometryBinary search+1No attempts yet2s512 MBJudgeable
Safe AreaGiven a rectangular screen, circular machine radius, and laser lines with thickness, decide if some circle center avoids all beams.Medium6GeometryImplementationNo attempts yet8s512 MBJudgeable
Area between a lattice path and its chordGiven a monotone path of up and right steps, compute the total area between the path and the straight chord from start to end.Medium6GeometryPrefix sum+2No attempts yet8s512 MBJudgeable
Tiling PolygonsTile a rectilinear polygon with 1x3 and 3x1 tiles, choosing at each step the lexicographically smallest covering grid.Medium6BacktrackingRecursion+2No attempts yet8s512 MBJudgeable
Stupendous BowtiesGiven N distinct integer points, count unordered pairs of axis-aligned right triangles that share only the right-angle vertex.Medium6GeometryCombinatorics+2No attempts yet2s512 MBJudgeable
AliensGiven N points, choose an integer axis value s minimizing new points needed so the set is symmetric about x = s/2, then output those points. Ties go to the smallest s, output sorted by x then y.Medium6Hash mapSorting+2No attempts yet1s128 MBJudgeable
TrokutGiven two numbers in this triangular arrangement, list every third number that completes an equilateral triangle with sides parallel to the 1-2-3 grid.Medium6MathGeometryNo attempts yet0.5s256 MBJudgeable
ArchitectGiven N tree points and Q axis-aligned polygons of at most 12 vertices, count for each polygon how many trees lie inside it, border included.Medium6GeometryArray+2No attempts yet1s64 MBJudgeable
Guard dogFind an integer lattice point on a square roof where a chain can be anchored so it reaches every hatch center without leaving the roof, choosing the smallest coordinates.Medium6GeometryBrute force+2No attempts yet1s64 MBJudgeable
Cow ChecklistFind the cheapest path that visits all Holsteins in order and all Guernseys in order, starting at Holstein 1 and ending at Holstein H.Medium6Dynamic programmingGeometryNo attempts yet2s512 MBJudgeable
Plane GameGiven N points, rotate and translate them arbitrarily so that as many points as possible lie on the two coordinate axes; output that maximum count.Medium6GeometryBrute force+2No attempts yet2s512 MBJudgeable
Armistice NegotiationGiven two sets of points, decide whether a straight line exists that keeps each country's cities strictly on opposite sides.Medium6GeometryDivide and conquer+2No attempts yet2s512 MBJudgeable
Impromptu Outdoor GalleryGiven N points in general position, find twice the smallest area of a simple quadrilateral formed by four of them.Medium6GeometryBrute forceNo attempts yetNot set1024 MBJudgeable
Trapezoid puzzleTile a triangular-grid hexagon of shaded cells with 3-triangle trapezoids, backtracking in a fixed canonical order and colouring pieces greedily so no two equal colours share an edge.Medium6BacktrackingGreedy+2No attempts yet0.5s1024 MBJudgeable
Impossible DesignGiven the circle order of a permutation of 0 to N-1, decide whether chords drawn between every pair at height x+y ever intersect.Medium6GeometryCombinatorics+1No attempts yet1s128 MBJudgeable
The Climbing WallGiven holds on a wall, find the fewest holds Bessie must step on to climb from within 1000 mm of the ground to within 1000 mm of the top, moving only between holds at most 1000 mm apart.Medium6GraphBFS+2No attempts yet2s512 MBJudgeable
Punching PowerChoose the largest subset of given grid points so every pair is more than 1.3 meters apart.Medium6GraphGreedy+2No attempts yet2s512 MBJudgeable
HipercampoGiven two anchors on the x-axis and N points above, choose the largest subset whose segments to both anchors meet only at the anchors.Medium6GeometrySorting+2No attempts yet1s1024 MBJudgeable
Honey HeistBuild the adjacency of a hexagonal honeycomb of side R, remove wax cells, and find the shortest number of chewed cells from A to B, checking it against N.Medium6GraphBFS+2No attempts yet2s512 MBJudgeable
Straight ShotChoose a fixed heading so a robot crossing north-south moving sidewalks lands at (X,0); report the travel time or "Too hard" if it exceeds 2X/v.Medium6MathBinary search+1No attempts yet1s512 MBJudgeable
Move AwayFind the farthest point from the origin inside the intersection of n disks and print that distance rounded to three decimals.Medium6GeometryBinary searchNo attempts yet2s512 MBJudgeable
Asphalt PavingGiven segments on a triangular grid, choose the largest subset so that no two share an endpoint at an acute angle.Medium6GraphDynamic programming+2No attempts yet1s512 MBJudgeable
Rock ClimbingGiven n anchor points and a four-limb climbing model with pairwise distance and height limits, find the fewest moves to touch location n.Medium6BFSGraph+2No attempts yet2s512 MBJudgeable
Basketball rebound placementGiven opposing and candidate positions plus rebound spot probabilities, choose 5 of n candidate spots to maximize expected points from the resulting fast-break race.Medium6Brute forceCombinatorics+2No attempts yet2s512 MBJudgeable
Particle CollisionThree equal circles at rest; particle 1 moves along a given vector and transfers motion on contact. Decide which of five collision chains occurs.Medium6GeometrySimulation+2No attempts yet1s512 MBJudgeable
Designing the ToyGiven three target projection areas a, b, c, find the minimum number of voxels in a 3D figure whose three orthogonal projections have those exact areas, or report -1.Medium6MathGreedy+2No attempts yet3s512 MBJudgeable
A Packing ProblemGiven a rectangle and two circles, decide whether both circles fit inside the rectangle without overlapping, allowing tangency.Medium6GeometryMath+2No attempts yet2s512 MBJudgeable
Greeting CardCount how many pairs of given lattice points lie exactly 2018 units apart.Medium6Hash mapMath+2No attempts yet2s512 MBJudgeable
Origami, or the Art of Folding PaperFold a rectangle several times along axis-aligned lines, punch holes in the folded stack, and count how many holes each punch makes in the unfolded sheet.Medium6SimulationImplementation+2No attempts yet2s512 MBJudgeable
Water TestingGiven the corner points of a simple polygon in order, count the integer lattice points that lie strictly inside it.Medium6GeometryMath+2No attempts yet2s512 MBJudgeable
Racing Around the AlphabetCompute the running time for a player who follows a message's characters around 28 marks on a circle, using the shortest arc between marks and 1 second per pickup.Medium6MathGeometry+2No attempts yet2s512 MBJudgeable
The Circumcenter and the Incenter Are LoveGiven circumradius R and inradius r, output the floor of the squared distance between a triangle's circumcenter and incenter using Euler's formula R^2 - 2Rr.Medium6MathGeometryNo attempts yet1s512 MBJudgeable
Horse RidingPlace the square's corners at (0,0), (b,0), (0,b), (b,b), compute A's coordinates from its distances to two adjacent corners, then output the squared distance to the point m along the side between them.Medium6GeometryMath+1No attempts yet1s512 MBJudgeable
Triangle HackerGiven the three side lengths of an acute triangle, compute its area, circumradius, inradius, circumcenter-incenter distance, and the sum of the circumcenter's perpendicular distances to the sides.Medium6MathGeometryNo attempts yet1s512 MBJudgeable
Oblongs and Right TrianglesCount 4-black-point sets forming a non-square rectangle and 3-white-point sets forming a right triangle, disjoint and with positive area.Medium6Brute forceGeometry+2No attempts yet1s256 MBJudgeable
Traveling Salesman 3Find the minimum-length round trip that visits all N cities exactly once and returns to the start, where N is at most 16.Medium6Dynamic programmingBit manipulation+2No attempts yet1s512 MBJudgeable
Horse DrawingGiven axis-aligned segments and a point T, keep every segment connected to a segment through T, then print the minimal bounding grid marking drawn points with '#'.Medium6GraphBFS+2No attempts yet2s512 MBJudgeable
Line Segment Intersection 2Given two line segments by their integer endpoints, decide whether they intersect, counting endpoint touching as an intersection.Medium6GeometryMath+2No attempts yet0.25s512 MBJudgeable
CanalPlace one horizontal and one vertical line so the largest distance from any given point to the nearer line is minimized, and print that distance.Medium6Binary searchSorting+2No attempts yet1.5s512 MBJudgeable
ZiplineFor each zipline, find the minimum and maximum cable length so the rider's lowest point stays at least r meters above the flat ground.Medium6GeometryBinary search+2No attempts yet1s1024 MBJudgeable
TriangleGiven N plane points and Q query points, count epsilon-isosceles triangles having the query point as vertex and two distinct given points as the others, where two side lengths differ by less than 0.0001.Medium6GeometryHash map+1No attempts yet2s512 MBJudgeable
Keep Him InsideGiven a convex polygon of guard points and an interior prisoner point, assign nonnegative weights summing to 1 whose weighted average equals the prisoner.Medium6GeometryMath+2No attempts yet1s512 MBJudgeable
Beer VisionCount the nonzero shift vectors (X, Y) for which some set of stars, shifted by that vector, equals the given set of points.Medium6Hash mapGeometry+2No attempts yet2s512 MBJudgeable
Building BoundariesGiven three axis-aligned rectangles that can rotate in place, find the minimum area of a bounding rectangle that holds them without overlap.Medium6GeometryBrute force+2No attempts yet1s512 MBJudgeable
BoulderingOn a grid of holds with grip costs, find the minimum total Euclidean path length from the bottommost hold to the topmost hold, where consecutive holds must be within reach r and total cost stays at most s.Medium6GraphShortest path+2No attempts yet2s512 MBJudgeable
Smallest Regular SubpolygonGiven a regular N-gon, find the smallest number of its vertices that themselves form a regular polygon.Medium6Number theoryMath+2No attempts yet2s512 MBJudgeable
Model CrystalGiven the number of sides A and a temperature drop B, count the minimal crystals in the growing regular polygon.Medium6MathImplementation+2No attempts yet1s1024 MBJudgeable
VisibilityGiven N grid points, count ordered pairs (X, Y) such that Y lies strictly inside the 60 degree wedge opening south from X.Medium6GeometrySorting+2No attempts yet2s512 MBJudgeable
Cosmic CleanerFor each test case, compute the total volume of the parts of n non-overlapping asteroids that lie inside a larger cleaning sphere.Medium6GeometryMath+1No attempts yet2s512 MBJudgeable
RainsGiven a grid of regular N-gons with side S and a brain of radius R, find the probability a random brain center lands close enough to a thread to be cut.Medium6GeometryProbability+2No attempts yet2s512 MBJudgeable
Triangles (Silver)Given N points, sum twice the areas of all right triangles whose legs are parallel to the axes, modulo 1e9+7.Medium6MathGeometry+2No attempts yet1s512 MBJudgeable
Intersection of ParabolasFind the area of the region bounded by the parabolas y=(x-a)^2 and x=(y-a)^2, given a up to 10^18, printed to exactly 10 decimals.Medium6MathGeometry+2No attempts yet1s256 MBJudgeable
Triangle PartitionGiven 3n points with no three collinear, partition all of them into n disjoint triangles and output the indices used by each triangle.Medium6GeometrySorting+2No attempts yet1s256 MBJudgeable
Flat EarthGiven a sphere and a plane, compute the area of the sphere's orthogonal projection onto the plane.Medium6GeometryMath+2No attempts yet2s512 MBJudgeable
Broken Line 01Given dots with distinct x and y coordinates, construct a horizontal/vertical broken line from the origin that passes through every dot, minimizing segments for partial score.Medium6GreedySorting+2No attempts yet0.1s512 MBJudgeable
Broken Line 02Construct a rectilinear broken line from the origin that passes through every given dot, minimizing the number of segments; scored by segment count.Medium6SortingGreedy+2No attempts yet0.1s512 MBJudgeable
Broken Line 10Given n points with distinct x and y, output a rectilinear broken line from the origin that passes through every point, using few segments.Medium6SortingGreedy+2No attempts yet0.1s512 MBJudgeable
Convex Polygon Intersection AreaGiven two convex polygons with vertices in counterclockwise order, compute the exact area of their intersection region within a tight error tolerance.Medium7GeometryDivide and conquer+1No attempts yet2s128 MBJudgeable
Tilted Square DisplayPlace 45-degree tilted squares along the x-axis one by one without overlap, then find which squares are visible when viewed from directly above.Medium7GeometrySimulation+2No attempts yet2s128 MBJudgeable
Teacher Cho ForceGiven a moving catcher and N moving students, compute the maximum number of students that can simultaneously lie within radius R at any nonnegative time.Medium7IntervalsMath+2No attempts yet2s128 MBJudgeable
Running CourseGiven up to 100,000 2D points, compute the squared distance between the farthest pair of points.Medium7GeometrySorting+2No attempts yet2s256 MBJudgeable
Jimin and Hansu's Orchard SplitGiven up to 50 weighted points on a plane, find a line avoiding all points that splits them into two groups minimizing the difference of their value sums.Medium7GeometrySorting+2No attempts yet2s128 MBJudgeable
Candy Stair ClimbFind the maximum candies collectible by jumping between horizontal stair segments within distance K, never decreasing height, starting from the ground.Medium7Topological sortGraph+2No attempts yet2s128 MBJudgeable
HoneycombMap spiral-numbered hexagonal rooms to coordinates and print the room numbers along a shortest hex-grid path between two given rooms.Medium7GeometryMath+2No attempts yet2s128 MBJudgeable
Number of PolygonsGiven up to 50 lines defined by point pairs, compute the number of bounded convex polygonal regions formed by their arrangement.Medium7GeometryMath+2No attempts yet2s128 MBJudgeable
Distance Conditions for Four PointsGiven all pairwise distances among four points as a 4x4 integer matrix, decide if distinct points realizing these distances exist in 3D space.Medium7GeometryMath+1No attempts yet2s128 MBJudgeable
Paper OverlayOverlay two grid papers, each freely rotated, flipped, and positioned, then find the largest all-X rectangle in the combined grid.Medium7MatrixBrute force+2No attempts yet2s128 MBJudgeable
Restoring a PictureRestore the minimum number of white cells to black in a corrupted grid so every black group becomes row and column convex and connected again.Medium7MatrixBFS+2No attempts yet2s128 MBJudgeable
Number of DrawingsGiven T polylines defined by their points, count how many separate connected drawings form when polylines that touch or overlap are merged into one group.Medium7GeometryUnion-find+2No attempts yet2s128 MBJudgeable