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
PillarsGiven a grid with 2x2 pillars spaced apart, construct the unique Hamiltonian circuit through all free cells defined by a fixed local rule.Hard8ImplementationSimulation+2No attempts yet2s512 MBJudgeable
Drawing a Character FaceGiven three circles, compute the area of their union, counting overlaps once, and print it to six decimal places.Hard8GeometryMath+2No attempts yet0.1s256 MBJudgeable
Getting a Jump on CrimeGiven building heights on a grid, find the minimum number of jumps to reach each roof, where a jump is valid only if its parabola clears every building between the two roofs.Hard8GraphBFS+2No attempts yet2s1024 MBJudgeable
Panda PreserveGiven a simple polygon and receivers at its vertices with a common radius, find the smallest radius whose union of disks covers the whole polygon.Hard8GeometryBinary search+2No attempts yet10s1024 MBJudgeable
Single Cut of FailureWires cross a rectangle between boundary sides; find the fewest straight cuts connecting different sides that cross every wire, and output the lexicographically smallest such cut.Hard8GeometrySorting+2No attempts yet6s1024 MBJudgeable
Pineapple PizzaGiven n points and a center Q, decide whether k rays from Q can split the plane so every sector holds exactly n/k points, with no point on a ray.Hard8GeometrySorting+2No attempts yet1s256 MBJudgeable
Turf WarsEach gang owns disjoint axis-aligned rectangles; pick exactly one rectangle to drop per gang so that no two kept rectangles from different gangs overlap, and report whether this is possible.Hard8GeometryBrute force+2No attempts yet2s512 MBJudgeable
ShootingsGiven non-overlapping axis-aligned rectangles and shots that are vertical or 45-degree half-lines, compute for each shot the squared total length of its intersection with all rectangles.Hard8GeometrySorting+2No attempts yet1s512 MBJudgeable
TrianglesFind the number of vertices of the convex hull of n points using only clockwise or counterclockwise orientation queries on triples, with a query budget.Hard8GeometryDivide and conquer+2No attempts yet2s512 MBJudgeable
Battle RoyaleFind the shortest path between two points inside a circle while staying outside an inner red circle, touching boundaries only.Hard8GeometryMath+2No attempts yet2s512 MBJudgeable
Amateur Radio NetworkSplit at least 4 points into two groups of size at least 2 minimizing the largest same-group pairwise distance, and output that diameter rounded up to 0.01.Hard8GeometryBinary search+2No attempts yet2s512 MBJudgeable
Fair ShareGiven n weighted points around the origin, choose a line through the origin that splits them into two half-planes, minimizing the absolute difference of the two half-plane weight sums.Hard8GeometrySorting+2No attempts yet5s512 MBJudgeable
I'm a FanFind the smallest CCW rotation angle whose swept orbit of a star-shaped polygon around the origin is a full disk.Hard8GeometryMath+2No attempts yet2s512 MBJudgeable
Peace SignFind the similarity transform (translation, rotation, uniform scale) of the first segment set that matches the most segments of the second set, counting exact matches.Hard8GeometryHash map+2No attempts yet2s512 MBJudgeable
Folding the FigureGiven a connected polyomino of n cells that results from folding a k-cell polyomino along one grid line, reconstruct any valid original k-cell figure and the fold line.Hard8ImplementationGeometry+2No attempts yet2s512 MBJudgeable
Secret CodeFind the probability of three uniformly timed agents meeting pairwise through their fixed waiting windows, then print the scenario indices sorted by that probability.Hard8CombinatoricsGeometry+2No attempts yet1s512 MBJudgeable
RectanglesGiven up to 100,000 axis-aligned rectangles drawn by XOR-flipping pixels on a white field, find the total count of black pixels.Hard8Segment treePrefix sum+2No attempts yet2s512 MBJudgeable
Joining CapitalsConnect all capitals with degree exactly one through Steiner points (non-capitals) at minimum Euclidean total cost.Hard8GraphMinimum spanning tree+2No attempts yet2s512 MBJudgeable
Escape, Polygon!Given an integer convex polygon of up to 100000 vertices, count the triples of its sides whose supporting lines form a triangle containing the polygon. Output that count.Hard8GeometryCombinatorics+2No attempts yet2s512 MBJudgeable
Gathering Red-Black FruitsCount how many distinct rankings of N children can arise from scoring each red fruit r and black fruit b for some positive integers r, b.Hard8GeometrySorting+2No attempts yet2s512 MBJudgeable
DiscsAssign nested discs to N given lattice centers and choose radii so every pair of discs is nested, minimizing the total radius sum.Hard8GeometryDynamic programming+2No attempts yet1s512 MBJudgeable
Access PointsPlace n teams so both coordinates are nondecreasing along IDs, minimizing the sum of squared distances to fixed access points.Hard8Dynamic programmingDivide and conquer+2No attempts yet1s512 MBJudgeable
Knights and DragonsGiven n distinct points (strength, magic), decide for each whether it lies in the convex hull of the others, since a point is reachable by repeated weighted averaging of the other points exactly when it is not a vertex of the hull.Hard8GeometrySorting+2No attempts yet4s512 MBJudgeable
Shooter IslandOn a 50 by 100000 grid, rectangles flood when hit, and after each query decide whether a radius-0.31416 boat can sail between two given squares on the remaining water.Hard8Union-findIntervals+2No attempts yet3s512 MBJudgeable
BulldozerChoose two parallel lines and take every weighted point between them, maximizing the sum of gold values minus rock costs.Hard8GeometrySorting+2No attempts yet2s512 MBJudgeable
Spotlight MovementGiven N spotlights whose centers move around polygonal orbits, decide whether Ciel can walk from a start point to an end point while staying inside at least one illuminated circle at all times.Hard8GeometrySimulation+2No attempts yet2s512 MBJudgeable
Gravity PointA random mass for tiles A and B is drawn from given ranges; find the chance the grid's center of gravity falls in a filled cell.Hard8GeometryProbability+2No attempts yet2s512 MBJudgeable
Sum of VectorsChoose two of N vectors, each optionally sign-flipped per coordinate, to minimize the norm of their sum and output the pair with the chosen flips.Hard8SortingGeometry+2No attempts yet0.5s512 MBJudgeable
Piece of CakeGiven a convex polygon with n vertices in clockwise order, compute the expected area of the convex polygon formed by picking k of the vertices uniformly at random.Hard8CombinatoricsGeometry+2No attempts yet2s512 MBJudgeable
Intersecting RectanglesGiven n axis-aligned rectangles with all x and y coordinates distinct, decide whether any two boundaries cross or touch. One rectangle fully containing another does not count.Hard8SortingSegment tree+2No attempts yet2s512 MBJudgeable
Superb DartGiven a planar straight-line graph, list the areas of its bounded faces in increasing order, rounded to two decimals.Hard8GeometryGraph+2No attempts yet1s512 MBJudgeable
Union of BallsAll ball centers lie on the x-axis, so the union is a solid of revolution; compute its volume as p/q times pi and output p times q inverse mod 1e9+7.Hard8GeometrySorting+2No attempts yet2s1024 MBJudgeable
Making a FlyswatterGiven a simple polygon, find the expected squared distance between two points chosen independently and uniformly inside it.Hard8GeometryMath+2No attempts yet1s1024 MBJudgeable
BorderGiven an N by N grid of species (N at most 4), find a non-self-crossing border path from the top-left to the bottom-right corner so that different species end up in separate regions, or report that none exists.Hard8GraphBrute force+2No attempts yet1s256 MBJudgeable
Paris by NightGiven N graded points in general position, pick two boundary monuments and split the rest by the line through them to minimize the absolute difference of the two side sums.Hard8GeometrySorting+2No attempts yet15s512 MBJudgeable
Travel GuideGiven a weighted undirected graph with three special nodes, count the vertices that are not dominated in all three distances by another vertex.Hard8Shortest pathGraph+2No attempts yet6s512 MBJudgeable
Running RoutesGiven chords of a convex n-gon, find the largest set of chords no two of which share any common point, including endpoints.Hard8Dynamic programmingIntervals+2No attempts yet12s1024 MBJudgeable
Frog JumpGiven N disjoint horizontal line segments, two logs are connected if a vertical jump between them crosses no other log; answer queries on whether logs are reachable.Hard8GeometryUnion-find+1No attempts yet1s512 MBJudgeable
ExamFor each of Q threshold triples, count students with S>=X, T>=Y, and S+T>=Z, where N and Q reach 100000.Hard8SortingPrefix sum+2No attempts yet3s1024 MBJudgeable
Circle GardenGiven side lengths of a cyclic polygon, find the circumradius, or report no circle, an outside center, or a radius over 120 inches.Hard8GeometryMath+2No attempts yet1s512 MBJudgeable
Pizza Grows as You Slice ItFor each K, choose the number of cuts that maximizes the pieces kept after giving away 1+2+...+k pieces to Yunhee.Hard8MathCombinatorics+1No attempts yet1s256 MBJudgeable
WasherPartition up to 100 points in 3D into at most k groups (k <= 2) to minimize the sum of squared distances to each group's centroid.Hard8GeometryDivide and conquer+2No attempts yet1s512 MBJudgeable
Drive SafelyPlace k speed limit signs on a polyline road so that travel time is minimized, where each turn caps the speed limit by |180 - alpha| km/h.Hard8Dynamic programmingGeometry+2No attempts yet1s512 MBJudgeable
Interstellar TravelGiven n angular intervals where each star contributes t - s*dist(a,b), find the launch angle b maximizing the sum of contributions.Hard8GeometryMath+2No attempts yet5s512 MBJudgeable
Building the Perfect HouseGiven N points, none at the origin, find the largest square centered at the origin that contains no point strictly inside it, then print its perimeter to four decimals.Hard8GeometryBinary search+2No attempts yet1.5s512 MBJudgeable
Dazzling StarsGiven N stars with coordinates and brightness, decide whether some rotation of the picture makes brighter stars print no later than dimmer ones, where printing goes top to bottom.Hard8GeometrySorting+2No attempts yet0.2s512 MBJudgeable
Great Farmer Kim SanghyukChoose a radius r to maximize the daily profit from crops inside the circle (each worth wi times its distance to the boundary) minus the management cost A*r^2.Hard8GeometryMath+2No attempts yet2s1024 MBJudgeable
Cafebazaar's Chess TournamentGiven n players each with an opening and ending skill, count how many distinct tournament scores a new player with freely chosen distinct skills can achieve.Hard8GeometrySorting+2No attempts yet2s512 MBJudgeable
Face Recognition AlgorithmGiven a planar straight-line embedding of a connected graph, decide whether every face, including the outer one, is bounded by exactly three edges.Hard8GeometryGraph+2No attempts yet2s512 MBJudgeable
BaklawaGiven a huge cuboid with up to 100 poisonous unit cells, players alternate cutting off a safe cuboid half; decide who wins under optimal play.Hard8Game theoryGeometry+2No attempts yet2s512 MBJudgeable
Invited SpeakersGiven n red and n blue points in the plane with distinct x and y coordinates and no three collinear, draw n disjoint polygonal chains pairing each red point with a blue point.Hard8GeometryGreedy+2No attempts yet2s512 MBJudgeable
New Year and Castle ConstructionGiven n points with no three collinear, count over all points p the number of 4-point subsets whose convex quadrilateral strictly contains p, and sum these counts.Hard8GeometryCombinatorics+2No attempts yet3s512 MBJudgeable
Lying From YouGiven n lines y = a_i x + b_i, change coefficients at L1 cost so all lines pass through one point; find the infimum total cost.Hard8MathGeometry+2No attempts yet10s512 MBJudgeable
Hotter-colderAn interactive problem: locate a hidden point in a d-dimensional integer grid using at most 100d queries that only report whether the latest Chebyshev distance got smaller or larger.Hard8Binary searchImplementation+2No attempts yet1s256 MBJudgeable
Boring GameDecide the winner of a coin-flipping game on a huge N by N board where each move flips a rectangle whose bottom-right corner is heads, with heads cells given as a union of M rectangles.Hard8Game theoryCombinatorics+2No attempts yet4s512 MBJudgeable
Three PointsGiven three points A, B, C, find a point P minimizing |PA| + 2|PB| + 3|PC| and output that minimum distance.Hard8GeometryMath+2No attempts yet1s512 MBJudgeable
Simple PolygonGiven a perimeter l and area s, construct a simple rectilinear polygon with exactly that perimeter and area, or report that none exists.Hard8GeometryMath+2No attempts yet1s512 MBJudgeable
Mission PossibleGiven up to 50 disjoint circular sensors inside a rectangle, output at most 1000 waypoints for a polyline from start to target that stays inside the rectangle and never enters any sensor disk.Hard8GeometryGraph+1No attempts yet1s512 MBJudgeable
Piecewise LinearityDecide whether a piecewise linear function given by n+1 increasing x-coordinates can be written as a real linear combination of absolute value terms |x - a_i|.Hard8MathGeometry+1No attempts yet1s512 MBJudgeable
Donut-shaped EnclosurePlace a Chebyshev-distance donut with inner radius L and outer radius R at a lattice center to maximize the total weight of covered points.Hard8GeometryPrefix sum+2No attempts yet3s1024 MBJudgeable
Very New YorkGiven up to 100,000 restaurant points on a grid, answer 100,000 queries counting how many points lie within Manhattan distance d of a query point.Hard8GeometryDivide and conquer+2No attempts yet2s256 MBJudgeable
SheepGiven n linear sheep trajectories on [0,T] and a shepherd that also moves linearly, minimize the maximum over sheep of (max(s-h))^2 + (min(s-h))^2.Hard8GeometryBinary search+2No attempts yet2s256 MBJudgeable
The Catcher in the RyeGiven a rectangle split into three vertical strips with different travel speeds, find the fastest route from the bottom-left to the top-right corner.Hard8GeometryBinary search+2No attempts yet1s512 MBJudgeable
ImmigrationPeter moves along the x-axis while tracking an object whose velocity changes n times; find the maximum absolute angular speed of his gaze from time t0 onward.Hard8GeometryMath+2No attempts yet2s256 MBJudgeable
TrianglesGiven up to 2000 distinct points, count right triangles formed by three of the points whose area falls in the inclusive range [A, B].Hard8GeometryHash map+2No attempts yet10s256 MBJudgeable
Urban BlightGiven points and weighted segments, find a horizontal line whose intersection with the segments maximizes the total weight of segments it touches.Hard8GeometrySorting+2No attempts yet2s1024 MBJudgeable
A Game with GrundyFor each i from 0 to N, count integer x positions with L <= x <= R that lie strictly inside at most i of N triangular visibility wedges.Hard8GeometrySorting+2No attempts yet1s512 MBJudgeable
Folded Paper PaintingSimulate K rounds of folding a W by H rectangle along a vertical line and several horizontal folds, painting one rectangle each round through all layers, and report the unpainted area at the end.Hard9GeometrySimulation+2No attempts yet2s128 MBJudgeable
Coloring RectanglesGiven N rectangles, choose exactly K of them to maximize the total visible union area under a max-index-wins overlap rule, picking the lexicographically smallest tie-break.Hard9GeometryDynamic programming+2No attempts yet2s128 MBJudgeable
Goal CelebrationGiven a point inside a field with polygonal obstacles, find the farthest boundary point reachable by a straight segment that avoids the obstacles' interiors.Hard9GeometrySorting+2No attempts yet2s128 MBJudgeable
Robot ArmGiven a rectilinear factory polygon and five candidate fixed points, decide for each whether an L-shaped two-segment robot arm confined to the polygon can reach every interior point.Hard9GeometryIntervals+2No attempts yet5s128 MBJudgeable
Wake Up!Count the distinct points where any two of up to 20,000 line segments intersect, using an efficient computational geometry sweep.Hard9GeometryDivide and conquer+2No attempts yet1s128 MBJudgeable
Choosing PointsGiven up to 1000 planar points, find the largest subset where every line through two chosen points also passes through a third chosen point, or report -1 if impossible.Hard9GeometryCombinatorics+2No attempts yet2s128 MBJudgeable
Travel GuideFind the minimum time for a guide starting at the origin to intercept N moving tourists in some order and send them home, then return herself.Hard9Brute forceBinary search+2No attempts yet2s128 MBJudgeable
OrchardGiven up to 2500 non-overlapping colored rectangles, find the maximum area axis-aligned rectangle fully covered by orchards of one fruit type.Hard9GeometryMatrix+2No attempts yet2s64 MBJudgeable
FenceGiven a square field with 4N fence posts and up to 30000 convex polygonal rocks blocking sight lines, count how many posts are visible from a given viewpoint using angular occlusion by polygon silhouettes.Hard9GeometrySorting+1No attempts yet2s128 MBJudgeable
Square and PointsGiven points inside a unit square with 4 fixed corners, find where to move the points to minimize the Steiner-tree-like minimum spanning length, then among those optimal configurations minimize total movement of points.Hard9GeometryMath+1No attempts yet2s128 MBJudgeable
Waiting for the DogGiven rectangular obstacles, entrance, exit, and a waiting time, compute the total area of points whose shortest-path distances from both entrance and exit sum to at most a bound, in an L1-like grid metric with obstacles.Hard9GeometryShortest path+2No attempts yet1s256 MBJudgeable
Chip RoutingAssign each marked point on a square chip a direction toward a side so that drawn segments never cross or pass through other points, minimizing the total segment length.Hard9Dynamic programmingGreedy+2No attempts yet1s128 MBJudgeable
BeastsGiven lines splitting the plane, compute the exact squared minimum distance as a reduced fraction between two convex regions containing two extremely distant fixed points, bounded by half-planes determined for each side.Hard9GeometryBinary search+1No attempts yet3s128 MBJudgeable
Fields and FarmersGiven initial unit-square fields, count subsets whose repeated convex-hull-based expansion yields the same final parcel as the full set, modulo 1e9+7.Hard9GeometryCombinatorics+1No attempts yet1s128 MBJudgeable
Hanging HatsSimulate mages hanging triangular hats on a wall, tracking nail visibility and expulsion under coverage rules that require an advanced geometric data structure.Hard9GeometrySegment tree+2No attempts yet3s128 MBJudgeable
Origami Axiom Six: Counting FoldsGiven two point-line pairs, count the distinct fold lines (common tangents of two parabolas) satisfying Huzita's sixth origami axiom for up to 20000 test cases.Hard9GeometryMath+1No attempts yet1s512 MBJudgeable
AsteroidsGiven two convex polyhedra, find rotations and a touching translation that minimize the distance between their centers of mass without overlap.Hard9GeometryMath+1No attempts yet1s128 MBJudgeable
Grand Theft Auto WheelGiven star-shaped polar polygons for a bolt hole and several wrench lugs, determine which wrenches can be inserted but cannot fully rotate inside the bolt hole.Hard9GeometrySimulation+1No attempts yet3s256 MBJudgeable
Ground WorksSimulate water filling inside the region enclosed by a rotated Hilbert curve fractal against a tilted ground line, accounting for trapped air pockets, and output the flooded area to four decimals.Hard9GeometrySimulation+2No attempts yet3s256 MBJudgeable
TantrixSimulate the hexagonal tile game Tantrix and count all legal placements of hand tiles given complex forced-space and controlled-side rules.Hard9SimulationGeometry+2No attempts yet1s128 MBJudgeable
Cubic ColoniesGiven a 3x3x3 arrangement of unit cubic blocks (some missing) and two surface points, compute the length of the shortest path on the colony's outer surface between them, allowing passage through zero-width edge or vertex gaps.Hard9GeometryGraph+2No attempts yet5s128 MBJudgeable
Periodic PointsCount periodic points of period n for a piecewise linear map on [0,m] modulo a given value, detecting infinite solution cases.Hard9MathGeometry+1No attempts yet2s128 MBJudgeable
Origami Through-HoleSimulate repeated paper folds with layered segments and reflection/overlap propagation rules, then count how many layers a pin punch pierces.Hard9GeometrySimulation+1No attempts yet1s128 MBJudgeable
Lowest PyramidGiven an integer-coordinate base triangle, choose integer-coordinate apex points for its unfolded net so the folded tetrahedron has minimum positive height, or report impossibility.Hard9GeometryMath+1No attempts yet30s128 MBJudgeable
Polygons on the GridGiven up to six rod lengths, determine the maximum-area convex polygon whose edges are the rods with both endpoints on integer grid points.Hard9GeometryMath+1No attempts yet5s128 MBJudgeable
Crossing PrismsCompute the surface area of the solid formed by intersecting two identical prisms (one along the x-axis, one along the y-axis) whose cross section is a given simple polygon.Hard9GeometryMath+1No attempts yet1s128 MBJudgeable
Asteroid RangersGiven n moving points, count how many times the minimum spanning tree over all future times changes, plus the initial build.Hard9Minimum spanning treeGeometry+2No attempts yet1s128 MBJudgeable
Old Factory PlumbingChoose a water height so the flooded region avoids open holes unless plugged or piped, minimizing pipe distances plus 0.5 per plug.Hard9GraphMinimum spanning tree+2No attempts yet5s128 MBJudgeable
Affine MessGiven three integer start points and three integer end points, decide whether a snapped integer rotation, integer scaling, and integer translation map one set onto the other, and if so whether all such maps agree on the whole plane.Hard9GeometryMath+2No attempts yet2s128 MBJudgeable
Mummy MadnessGiven mummy start positions on an infinite grid, compute how many time steps a fleeing player survives when both sides move on a king-step grid.Hard9Binary searchGeometry+2No attempts yet6s128 MBJudgeable
Cubic RubeGiven two connected 5x5 height maps of unit cubes, decide whether the pieces can be rotated and translated in 3D to assemble a full 5x5x5 cube.Hard9ImplementationGeometry+2No attempts yet1s128 MBJudgeable
GuardPlace g guards on segments so every valuable point is seen, minimizing the largest value-times-distance risk, or report too few guards.Hard9GeometryBinary search+2No attempts yet1s128 MBJudgeable
Triangle CutsGiven a large triangle and four small triangles as angle triples in clockwise order, decide whether three straight cuts can produce exactly those four pieces.Hard9GeometrySimulation+2No attempts yet1s128 MBJudgeable