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
Celestial MapCount stars that, d years ago, lay in a plane through the origin and were exactly d from the origin.Medium4GeometryMath+1No attempts yet2s512 MBJudgeable
Justice Rains from Above!Given each robot's coordinates and missile speed, output the robot indices sorted by hit time (distance divided by speed), breaking ties by smaller index.Medium4SortingMath+1No attempts yet1s128 MBJudgeable
Galactic ConfederationGiven M planes and N planet positions, count how many planets fall in the most populated region formed by the planes.Medium4GeometryHash map+2No attempts yet2s512 MBJudgeable
Coast GuardDecide whether a coast guard boat can intercept a thief heading straight out to sea 12 miles away, given their speeds and starting distance apart.Medium4GeometryMath+2No attempts yet2s512 MBJudgeable
ElevatorGiven a rectangle and two circles, decide whether both circles fit inside the rectangle without overlapping.Medium4GeometryMathNo attempts yet2s512 MBJudgeable
Minimum Queen MovesGiven a queen's start and target square on an 8x8 board, print the minimum number of queen moves needed.Medium4MathImplementation+1No attempts yet2s512 MBJudgeable
Colored CubesCount how many distinct cube colorings appear in each test case, where two cubes match if some rotation makes all six face colors agree.Medium4ImplementationHash map+1No attempts yet2s512 MBJudgeable
Square DealGiven three rectangles, decide whether they can be glued edge to edge into a square, with rotations allowed.Medium4GeometryImplementation+1No attempts yet2s512 MBJudgeable
RasterizationCount the pixel centers inside or on a triangle with integer-coordinate corners, handling the collinear case as a segment.Medium4GeometryImplementationNo attempts yet2s512 MBJudgeable
Careful AscentGiven a target point and vertical strips that scale horizontal speed, find the launch horizontal velocity so the craft reaches the target at vertical speed 1.Medium4MathImplementation+2No attempts yet2s512 MBJudgeable
Balls and NeedlesGiven K segments in 3D defined by endpoint triples, decide whether they form a closed cycle in space and whether their projections onto the xy-plane form a closed cycle.Medium4GraphUnion-find+2No attempts yet2s512 MBJudgeable
Amusement Park QueueTwo people walk a fixed grid path one step per minute, offset by K minutes; count the minutes their cells touch in any of eight directions.Medium4SimulationImplementation+2No attempts yet1s128 MBJudgeable
MoocastEach cow has a point and a broadcast radius; find the starting cow whose one-way reachable set is largest.Medium4GraphDFS+1No attempts yet2s512 MBJudgeable
Rebel Against The Empire (Small)Given stationary points in 3D, find the smallest jump radius that lets you reach asteroid 1 from asteroid 0, ignoring the time limit.Medium4GraphUnion-find+2No attempts yet5s512 MBJudgeable
BeachCount the hexagon edges that separate land from water, ignoring any edge on the outer border of the map.Medium4ImplementationMatrix+2No attempts yet2s512 MBJudgeable
Three SquareGiven three rectangles, decide whether they can be rotated and placed without overlap to exactly fill a square.Medium4GeometryImplementation+1No attempts yet1s512 MBJudgeable
Hunter's ApprenticeGiven the vertices of a simple polygon in the order placed, decide whether they run counter-clockwise (print fight) or clockwise (print run).Medium4GeometryMathNo attempts yet2s512 MBJudgeable
IeumjulGiven a rectangle's width and height, compute the dimensions of the poster after the folded shape is determined geometrically.Medium4GeometryMath+1No attempts yet1s64 MBJudgeable
Venue Rental (Small)Given up to 100 axis-aligned rectangles, find the area of the union of all rectangles.Medium4ArrayImplementation+2No attempts yet2s256 MBJudgeable
Ample Syrup (Small)Choose K pancakes from at most 10 to stack largest radius on the bottom, maximizing the exposed surface area divided by pi.Medium4Brute forceSorting+2No attempts yet5s512 MBJudgeable
Jaehong's LadderGiven a rectangle's width, height, and a number of vertical strips, sum the lengths of the N-1 rungs where the strips cross the rectangle's diagonals.Medium4MathGeometry+2No attempts yet2s512 MBJudgeable
Forest PictureDraw an ASCII forest on an M by M canvas from tree or stump coordinates, clipping shapes that fall outside and framing the result with asterisks.Medium4ImplementationSimulation+2No attempts yet2s512 MBJudgeable
Anti-missile interceptGiven the missile parabola and the anti-missile launch point and speed, decide the firing time and angle that intercepts at time tK, or report failure.Medium4GeometryMath+1No attempts yet2s512 MBJudgeable
Hook or Be HookedEach polygon has a squared radius equal to its farthest vertex from the origin; find the K-th smallest such value and print it with two decimals.Medium4GeometrySorting+2No attempts yet1s512 MBJudgeable
Two BoxesGiven two axis-aligned rectangles, classify how they intersect: overlapping interiors (FACE), sharing a segment (LINE), touching at one point (POINT), or disjoint (NULL).Medium4GeometryImplementation+2No attempts yet2s512 MBJudgeable
Voronoi VillagesGiven N village positions on a line, find the smallest finite Voronoi neighbourhood size and print it with one decimal digit.Medium4SortingGeometry+2No attempts yet2s512 MBJudgeable
OBB (Oriented Bounding Box)Given two rotated 2D rectangles as vertex lists, test whether their areas overlap using the separating axis theorem on four edge normals.Medium4GeometryMath+1No attempts yet0.3s32 MBJudgeable
Uphill and GahuiGiven a polyline of checkpoints and two query positions, output the absolute average slope between them as a reduced fraction.Medium4GeometryMath+1No attempts yet1s256 MBJudgeable
Janitor TroublesGiven four side lengths that can form a quadrilateral, output its maximum possible area, given by Brahmagupta's formula with the semiperimeter.Medium4MathGeometry+1No attempts yet1s512 MBJudgeable
Goat RopeGiven a point outside an axis-aligned rectangle, print the minimum distance from the point to the rectangle's boundary.Medium4GeometryMath+1No attempts yet2s512 MBJudgeable
Partition of a CircleA circle is cut by two straight lines, giving four regions with three known boundary lengths; find the fourth length opposite the third.Medium4GeometryMath+1No attempts yet1s512 MBJudgeable
Circle Expert JinwooGiven the radii of the three excircles of a triangle, compute the incircle radius without constructing any triangle explicitly.Medium4MathGeometry+1No attempts yet1s512 MBJudgeable
Are You Listening?Given your point and n listening circles, find the largest radius centered there overlapping at most two of them; output the floor of it, or 0 if three already cover you.Medium4GeometryMath+2No attempts yet2s512 MBJudgeable
Good Pizza, Great PizzaGiven N points, find the area of the smallest 45-degree tilted square (rhombus) that contains all of them.Medium4GeometryMath+2No attempts yet1s256 MBJudgeable
Dome ConstructionGiven n points in 3D with non-negative y, find the minimum radius of a dome (hemisphere on the xz-plane) that contains at least k of them.Medium4Binary searchGeometry+2No attempts yet2s512 MBJudgeable
Chopping on LineA triangle is traced on a rectangular sheet; find the order of the three edge-line cuts that minimizes total cut length, with a fixed tie-break order.Medium4GeometryBrute force+2No attempts yet1s512 MBJudgeable
Professor, I Want a JobGiven an N x N grid of desks, decide whether Seonggyu can escape the professor: distance at least 5 and at least three other students inside the rectangle or segment between them.Medium4ImplementationBrute force+1No attempts yet1s256 MBJudgeable
Hiding NutsGiven N grid points, pick the one minimizing the sum of Manhattan distances to all other points, breaking ties by smallest X then smallest Y.Medium4MathBrute force+2No attempts yet1s512 MBJudgeable
TATCKFor each test case, find the area of the smallest axis-aligned square that contains all given points.Medium4GeometryMath+2No attempts yet2s512 MBJudgeable
Isosceles trianglesCount the isosceles triangles whose three vertices are vertices of a regular n-gon, for n up to 1e9.Medium4CombinatoricsMath+2No attempts yet1s512 MBJudgeable
High-Rise BuildingsGiven the heights of N buildings in a row, find the maximum number of other buildings visible in a straight line of sight from any single building.Medium5GeometryBrute force+2No attempts yet2s128 MBJudgeable
Expandable Beautiful TrianglesCount the RGB-colored triangles on an N by M grid that share two vertices with another RGB triangle of strictly larger area.Medium5Brute forceGeometry+2No attempts yet2s128 MBJudgeable
Going HomeCompute the minimum time to reach the origin from (X,Y) by combining unit-speed walking with fixed-length D jumps costing T seconds each.Medium5MathGeometry+1No attempts yet2s128 MBJudgeable
Cutting to a TriangleGiven a convex polygon reduced to a triangle by repeatedly cutting ears, find the maximum possible area of the final triangle among its vertices.Medium5GeometryBrute force+1No attempts yet2s128 MBJudgeable
Protecting Three PeopleGiven a simple polygon with up to 10,000 vertices, determine for three query points whether each lies inside or on the polygon's boundary.Medium5GeometryMath+1No attempts yet2s128 MBJudgeable
Convex HullCompute the convex hull of up to 100,000 points and count only the hull's true vertices, excluding collinear boundary points.Medium5GeometrySorting+1No attempts yet2s128 MBJudgeable
LaserGroup buildings by the ray from the origin, sort each group by distance, and find buildings whose laser is blocked by a closer, equally tall or taller building.Medium5GeometrySorting+2No attempts yet2s128 MBJudgeable
Communicating with the Space GodsGiven points with some already connected, find the minimum total length of new passages needed to connect all points into one network.Medium5Minimum spanning treeUnion-find+2No attempts yet2s128 MBJudgeable
Field Mouse EscapeGiven mouse and tunnel coordinates plus a max travel distance, compute the minimum number of mice that cannot be matched to a distinct tunnel using bipartite matching.Medium5GraphGreedy+1No attempts yet2s128 MBJudgeable
Vegetarian Pool DividerGiven one endpoint on the boundary of a fixed right isosceles triangle, compute the other endpoint of a segment that splits the triangle into two equal-area regions.Medium5GeometryMath+1No attempts yet1s128 MBJudgeable
TripletsGiven a grid with letters placed on some cells, count how many triples of letters are collinear.Medium5GeometryCombinatorics+1No attempts yet1s128 MBJudgeable
Crane DeliveryGiven cranes with fixed positions and reach radii starting from a fixed entrance point, decide for each of K target points whether it lies in the union-reachability graph of overlapping crane discs starting from the entrance.Medium5GraphUnion-find+1No attempts yet1s128 MBJudgeable
ASCII FigureGiven a grid picture drawn with '.', '/', and '\' forming one closed polygon from diagonal cell segments, compute the polygon's area.Medium5GeometryMatrix+1No attempts yet1s128 MBJudgeable
Circles on a ScreenGiven up to 100 circles drawn on a w×h grid, count how many pixels remain black after the union of circles is painted white.Medium5GeometrySimulation+1No attempts yet3s256 MBJudgeable
Simple PolygonOrder given points into a specific simple polygon by picking a bottom-most anchor and sorting the rest by polar angle with a special tie-break for collinear groups.Medium5GeometrySorting+1No attempts yet1s128 MBJudgeable
HighwayGiven villages near a segment highway, find the minimum number of points on the segment so every village lies within distance D of some chosen point.Medium5GreedyGeometry+1No attempts yet1s128 MBJudgeable
3-Sided DiceDetermine whether a target 3-outcome probability vector lies in the convex hull (with strictly positive weights) of three given dice's probability vectors.Medium5GeometryMath+1No attempts yet1s128 MBJudgeable
Area of PolygonsGiven a simple integer-coordinate polygon, count how many unit grid squares have nonzero area of intersection with it.Medium5GeometrySimulation+1No attempts yet1s128 MBJudgeable
Windmill AnimationSimulate a line rotating counter-clockwise about a pivot point, switching pivot whenever the line hits another of the given points, and report the first S pivots. Repeat for each dataset.Medium5GeometrySimulation+2No attempts yet1s128 MBJudgeable
Folding GameFor each fold sequence on a rectangle, count how many paper layers sit under a given point.Medium5SimulationImplementation+2No attempts yet1s128 MBJudgeable
Underground CablesGiven up to 1000 points in the plane, find the minimum total length of non-crossing straight cables that connect all points.Medium5Minimum spanning treeGraph+1No attempts yet1s128 MBJudgeable
Logo 2One numeric argument in a turtle graphics program is missing; find the value that makes the turtle return to its starting point.Medium5GeometryMath+2No attempts yet1s128 MBJudgeable
Hermes' ColonyFor each province of 3 or 4 planar points, compute the length of the minimum Steiner tree connecting the cities, allowing extra junction points.Medium5GeometryMath+2No attempts yet1s128 MBJudgeable
War on WeatherCount how many surface targets have at least one satellite with a clear line of sight that does not pass through the Earth.Medium5GeometryMath+2No attempts yet1s128 MBJudgeable
Treasure MapGiven a step list and a magnetic declination, rotate every heading and find the minimum distance between the two resulting polylines.Medium5GeometryImplementation+2No attempts yet1s128 MBJudgeable
Building the ConstellationGiven n points in the plane, connect all of them with straight segments of Euclidean length so the total cost is minimized.Medium5Minimum spanning treeGraph+2No attempts yet1s128 MBJudgeable
Chocolate Chip CookiesGiven up to 200 points, find the maximum number that fit inside any circle of radius 2.5 cm, allowing the circle to extend past the dough edge.Medium5GeometryBrute force+1No attempts yet1s128 MBJudgeable
Thinking Inside the BoxFor each test case, report every stored Data Box that intersects, touches, or overlaps at least one Query Box, accounting for longitude wraparound.Medium5GeometryIntervals+1No attempts yet1s128 MBJudgeable
Crash and Go(relians)After each Gorelian lands in order, groups merge when one radio reaches another, meeting at the unweighted average of group positions and combining ranges by root sum of squares; report the final group count.Medium5SimulationUnion-find+2No attempts yet1s128 MBJudgeable
SquaresCount the number of squares whose four corners all come from a given set of integer-coordinate points, allowing tilted squares.Medium5GeometryHash map+1No attempts yet1s128 MBJudgeable
Dividing the LandFor each test case, split N cities with K-1 evenly spaced vertical or horizontal cuts, avoid cuts through cities, and print the minimum average |count - N/K| as a reduced fraction.Medium5SortingMath+2No attempts yet1s128 MBJudgeable
Cut the CakeSimulate n vertical cuts on a rectangular cake, tracking each rectangular piece and reassigning ids by area, then print all final piece areas sorted.Medium5SimulationImplementation+2No attempts yet1s128 MBJudgeable
Polygonal Line Shape SearchGiven a template orthogonal polygonal line, report which of up to 50 other lines match its shape under rotation and translation.Medium5GeometryImplementation+1No attempts yet1s128 MBJudgeable
ConstellationsGiven up to 500 star coordinates, connect each star to its nearest neighbor(s) and count the connected components of the resulting graph.Medium5GraphUnion-find+2No attempts yet1s128 MBJudgeable
Bat PositioningFind the point that equals the centroid of exactly the pointers lying at least 100 units away from it, rounding coordinates to the nearest integer.Medium5GeometryImplementation+2No attempts yet1s128 MBJudgeable
Foreclosure BoroughFor each polygon borough, compute the percentage of houses inside it that are in foreclosure, sort boroughs by rate, and print two-decimal rates with tie-breaking by borough number.Medium5GeometrySorting+1No attempts yet1s128 MBJudgeable
Electrical EngineeringFor each query point, find the strongest signal among routers whose segment to the point crosses no polygon wall, using 1/d^2 falloff.Medium5GeometryBrute force+2No attempts yet1s128 MBJudgeable
Time Is MoneyWe choose N-1 links forming a spanning tree minimizing SumTime*SumMoney, where each edge has a time and a money cost.Medium5Minimum spanning treeGeometry+2No attempts yet1s128 MBJudgeable
Bovine Bridge BattleCount sets of four points that are symmetric about some center, where each point pairs with its 180-degree rotation partner.Medium5Hash mapGeometry+2No attempts yet1s128 MBJudgeable
Radar InstallationEach island on the sea side of a line must be covered by radars of reach d placed on the line, so find the minimum number of placements or report -1 if some island is unreachable.Medium5GreedyIntervals+2No attempts yet1s128 MBJudgeable
The Loathesome Hay BalerRollers touch when center distance equals the sum of radii; find the path from the drive roller to the take-off roller and sum the absolute speeds, truncated.Medium5GraphDFS+2No attempts yet1s128 MBJudgeable
AreaGiven the move vectors of a robot tracing a grid polygon, compute the number of interior grid points, boundary grid points, and the area using Pick's theorem.Medium5GeometryMath+2No attempts yet1s128 MBJudgeable
GridlandFor a rectangular grid of towns with eight-direction roads, compute the length of the shortest tour that visits every town once and returns to the start.Medium5MathGreedy+2No attempts yet1s128 MBJudgeable
Horseshoe ScoringScore each four-toss turn by deciding ringer, toucher, swinger, or zero for each horseshoe and summing the points.Medium5GeometryImplementation+1No attempts yet1s128 MBJudgeable
EquidistanceGiven coordinates of locations on a sphere, for each query find the surface distance from a third point to the great circle equidistant from two given points.Medium5GeometryMath+2No attempts yet1s128 MBJudgeable
Bee MajaConvert a spiral hex-grid cell number into hexagonal axial coordinates using the orientation shown in the sample.Medium5MathImplementation+2No attempts yet1s128 MBJudgeable
Building a New DepotGiven the corner posts of an axis-aligned rectilinear polygon (listed in no particular order), reconstruct the polygon and compute its total perimeter.Medium5GeometrySorting+2No attempts yet1s128 MBJudgeable
The Perfect SymmetryGiven a set of distinct integer points, decide whether it has a center of symmetry and, if so, print that center to one decimal place.Medium5Hash mapGeometry+2No attempts yet1s128 MBJudgeable
CookiesGiven up to 10 points, find the diameter of the smallest enclosing circle.Medium5GeometryBrute force+2No attempts yet1s128 MBJudgeable
Polygon AreaGiven a grid-aligned orthogonally convex polygon as a string of unit moves, compute its area.Medium5GeometryImplementation+1No attempts yet1s1024 MBJudgeable
Space AntGiven N points with distinct x and y coordinates, output the order produced by repeatedly picking the most clockwise remaining point from the current one.Medium5GeometrySorting+2No attempts yet1s128 MBJudgeable
GunmanEach window is a rectangle at a distinct depth; decide whether one straight ray fired from the X axis can pass through all of them.Medium5GeometryBinary search+2No attempts yet2s128 MBJudgeable
DancersRepeatedly pair the two closest unpaired dancers, breaking ties by smaller indices, and output all pairs sorted.Medium5SortingGeometry+2No attempts yet1s128 MBJudgeable
Deepest StationGiven a surface point (x, y) and depth d, decide whether a single 45-degree staircase reaches (0,0,d), it is impossible, or print the shallowest intermediate lobby.Medium5GeometryMath+1No attempts yet1s128 MBJudgeable
Tiling VerificationGiven a floor and up to 100 rectangles, decide whether they overlap, stick out of the floor, or fail to cover it, printing which condition fails first.Medium5GeometryImplementation+2No attempts yet1s128 MBJudgeable
Yum YumFind the minimum number of straight lines needed to cover every integer-coordinate point in an (n+1) by (m+1) grid, excluding the frog's one starting point.Medium5MathNumber theory+2No attempts yet1s128 MBJudgeable
Telephone ExchangePick an integer tower height so the fees from houses fully covered by the circle exceed the height-dependent maintenance cost by as much as possible.Medium5GeometrySorting+2No attempts yet1s512 MBJudgeable
Phone PlotClassify each phone number as EXCELLENT, GOOD, or BAD by counting the fewest straight segments that cover its keypad trace.Medium5GeometrySimulation+1No attempts yet1s128 MBJudgeable
SymmetryDecide whether the given dots mirror exactly across some vertical line, printing YES or NO for each test case.Medium5Hash mapGeometry+1No attempts yet1s128 MBJudgeable
BridgeConnect all axis-parallel rectangular islands with bridges of minimum total squared shortest gap distance.Medium5Minimum spanning treeGeometryNo attempts yet1s128 MBJudgeable