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
PotholesPlace a straight rope across a rectangular lot without crossing any pothole so the total pothole area is split as evenly as possible, with tie-breaking rules.Hard9GeometrySorting+2No attempts yet1s128 MBJudgeable
Congruent Partition of ChocolateGiven a connected polyomino of at most 36 unit squares, decide whether it splits into two connected pieces that are congruent under rotation, reflection, and translation.Hard9Brute forceDFS+2No attempts yet30s128 MBJudgeable
Twirl AroundA bar inside a simple polygon rotates clockwise, pivoting on the wall whenever a new contact point appears; report the final position of one end, or the position when it jams.Hard9GeometrySimulation+2No attempts yet1s128 MBJudgeable
Around the TrackFind the Eulerian circuit of a planar-ish graph whose total turning cost is minimized, where each degree-4 node requires choosing how to pair its incident edges.Hard9GraphDynamic programming+2No attempts yet1s128 MBJudgeable
ASCII ArtRender triangles with ASCII characters, projecting 3D vertices through a camera onto an S by S screen grid with depth-based visibility.Hard9GeometryImplementation+2No attempts yet1s128 MBJudgeable
Two Circles in a Convex PolygonFind the largest radius R so that two non-overlapping circles of radius R fit inside a given convex polygon with N vertices.Hard9GeometryBinary search+2No attempts yet4s128 MBJudgeable
Giant CoverGiven axis-aligned boxes on a rectangular campus, find the minimum surface area of a convex solid above the ground that covers all boxes and is anchored to the campus boundary.Hard9GeometryMath+2No attempts yet1s128 MBJudgeable
TablesCount the tilings of a polyiamond on a triangular grid by isosceles trapezoids made of three unit triangles, given the shape's boundary as a sequence of grid nodes.Hard9Dynamic programmingGeometry+2No attempts yet1s128 MBJudgeable
Farmer JohnGiven start, goal, and up to 100 disjoint line-segment fences, find the shortest path that cannot cross any fence, touching allowed, and print the length to six decimals.Hard9GeometryGraph+2No attempts yet1s128 MBJudgeable
Ballroom LightsGiven point lightbulbs and disjoint circular columns inside a rectangle, compute the total length of the wall perimeter that some lightbulb can reach with a straight, unblocked ray.Hard9GeometryMath+2No attempts yet1s128 MBJudgeable
Not Too Convex HullPartition the nails into B convex polygonal groups, all sharing the origin nail, minimizing the total covered area, with the origin strictly inside the global hull.Hard9Dynamic programmingGeometry+2No attempts yet1s128 MBJudgeable
The Ideal CityGiven N cells forming a simply connected polyomino with no holes, compute the sum of grid shortest-path distances over all pairs, modulo 1e9.Hard9GraphBFS+2No attempts yet1s256 MBJudgeable
Tied DownGiven a closed polygonal rope loop and up to 10 collinear posts on its left, find the smallest set of posts to remove so the rope can be pulled free to the right.Hard9GeometryGraph+2No attempts yet1s128 MBJudgeable
Largest FenceGiven N grid points with no three collinear, find the size of the largest subset whose points form the vertices of a convex polygon.Hard9GeometryDynamic programming+2No attempts yet2s128 MBJudgeable
CastingFor a convex polygon, count the vertex pairs whose connecting line splits it into two parts that can each be pulled out by translation.Hard9GeometryTwo pointers+2No attempts yet1s128 MBJudgeable
PendulumSimulate an idealized pendulum swinging around point hooks on a wall and print the length of the periodic orbit it eventually settles into.Hard9GeometrySimulation+2No attempts yet1s128 MBJudgeable
The Herbalists' VillageGiven a friendship graph, decide whether it has a planar straight-line drawing where every vertex reaches infinity without crossing an edge.Hard9GraphGeometry+2No attempts yet1s128 MBJudgeable
LandingGiven up to 100000 integer points, find the largest circle whose boundary passes through at least three points and whose interior contains none, and output R^2 as a reduced fraction.Hard9GeometryCombinatorics+2No attempts yet1s128 MBJudgeable
Move that Mouse AGAINGiven up to 50,000 axis-aligned rectangles in a fixed bottom-to-top stacking order, process 50,000 point clicks, printing the topmost window at each point and moving it to the top of the stack.Hard9Segment treeGeometry+2No attempts yet3s128 MBJudgeable
Fast FoodGiven up to 50 points in a 10 by 10 square, compute for each point the area of its Voronoi cell within the square and report the percentage, rounded to nearest with halves up.Hard9GeometryDivide and conquer+2No attempts yet1s128 MBJudgeable
Joy of Mobile RoutingGiven grid building heights and antennas, find the shortest path from a start to a destination intersection where every visited intersection has line-of-sight to some antenna.Hard9GraphShortest path+2No attempts yet1s128 MBJudgeable
Deformed WheelSimulate a convex polygon rolling down a piecewise-linear hill until it comes to rest, and print the final position of its center of gravity.Hard9GeometrySimulation+2No attempts yet1s128 MBJudgeable
Find the BorderGiven a closed self-intersecting polyline, count the vertices of the border of its interior, the outer boundary enclosing all bounded regions.Hard9GeometryImplementation+2No attempts yet2s128 MBJudgeable
IlluminationAssign N fixed angular directions to N sources so their wedges cover the plane and the sum of projections is minimized, tie-broken lexicographically.Hard9GeometryCombinatorics+2No attempts yet1s128 MBJudgeable
Mirror TrapFor each box [-x,x]x[-y,y]x[-z,z], find the maximum Manhattan distance a laser at the origin can travel before returning to the origin, avoiding edges and vertices.Hard9MathNumber theory+2No attempts yet3s512 MBJudgeable
Dextrogyrate CamelFind the longest closed camel route that starts at oasis 1 heading to oasis 2, always turns right by at most 180 degrees at each oasis, never crosses itself, and visits the most distinct oases.Hard9GeometryDynamic programming+2No attempts yet1s512 MBJudgeable
Save the DinosaursFor each vacant point, add it to the existing set and report the area protected by the soldiers (the region where every move gets closer to some soldier).Hard9GeometrySorting+2No attempts yet1s128 MBJudgeable
Ice rinkA skater slides in straight lines across a square rink with rectilinear obstacles, stopping only at walls, and must reach the finish point in the fewest slides.Hard9BFSGraph+2No attempts yet1s128 MBJudgeable
Axes of SymmetryFor each simple polygon, count its axes of symmetry; n can reach 100000, so the check must run in near-linear time.Hard9String matchingGeometry+2No attempts yet1s128 MBJudgeable
Isles in a Triangular GridEnumerate all non-congruent triangular-grid isles of up to ten triangles, canonicalizing each by the lexicographically smallest clockwise boundary-turn word.Hard9GeometryBrute force+2No attempts yet1s128 MBJudgeable
IslandGiven a convex polygon with towns on its vertices, all diagonals and sides drawn, and some segments blocked, find the shortest path from vertex n to vertex 1 using roads and their crossings.Hard9GraphShortest path+1No attempts yet1s128 MBJudgeable
Ski RentalGiven daily snowfall amounts with point updates, answer queries asking for the maximum average snowfall over a consecutive run starting at a given day, reported as an irreducible fraction.Hard9Segment treeGeometry+1No attempts yet1s128 MBJudgeable
SpiderA walk on an infinite regular seven-legged web is given as turn directions; count the web nodes strictly inside the closed polygon it traces.Hard9GeometryImplementation+1No attempts yet1s128 MBJudgeable
Army TrainingGiven n points with no three collinear, answer m queries, each a simple clockwise polygon on those points, counting the points strictly inside it.Hard9GeometryCombinatorics+2No attempts yet2s512 MBJudgeable
DiamondGiven a convex polyhedron, choose one plane cut so that the two resulting pieces have the largest combined number of faces.Hard9GeometryBrute force+1No attempts yet2s512 MBJudgeable
FishesGroup recorded closed routes into the fewest fish, where two routes can follow on consecutive days if the start cells touch and every point is visible 24 hours earlier.Hard9GraphGeometry+2No attempts yet2s512 MBJudgeable
WatchmenCount, for each city gutter, how many Palace gutters a walker can reach while dodging rotating watchers' lines of sight.Hard9GeometryGraph+2No attempts yet2s512 MBJudgeable
Land TaxChoose a non-empty contiguous row and column range that maximizes combined row and column payments weighted by heights and widths.Hard9Divide and conquerGeometry+2No attempts yet1s128 MBJudgeable
Plot of LandGiven up to 3000 pine points and one million query rectangles, report the convex hull area of the points inside each rectangle.Hard9GeometryDivide and conquer+1No attempts yet1s128 MBJudgeable
CrystalSum the signed charges of all three-colored unit triangles in a hexagonal crystal filled row by row from a modular generator.Hard9MathGeometry+2No attempts yet1s128 MBJudgeable
RoofCompute the maximum height of the 45-degree straight-skeleton roof built over a rectilinear polygon.Hard9GeometryNo attempts yet1s128 MBJudgeable
Aquarium DrainageGiven an orthogonal aquarium floor with holes on its segments, compute the total drain time and the water left behind.Hard9GeometrySorting+2No attempts yet1s128 MBJudgeable
Möbius StripGiven m and n, compute the average graph distance over all ordered square pairs on the m by 2n Mobius grid.Hard9MathCombinatorics+2No attempts yet1s128 MBJudgeable
Fence WatchPlace the fewest sensors on a convex polygon boundary so every boundary point forms an angle from alpha to 360 degrees minus alpha with some sensor pair.Hard9GeometryGreedy+1No attempts yet1s128 MBJudgeable
MineshaftRun a pipe of straight segments up a winding polygonal shaft so each segment touches the walls in at least two places and the number of bends is minimal.Hard9GeometryGraph+1No attempts yet1s128 MBJudgeable
Anchored BalloonFind the greatest height a balloon tied to ground anchors by fixed-length ropes can reach while all ropes hold and none cross.Hard9GeometryBinary search+1No attempts yet1s128 MBJudgeable
Lonely MountainGiven two orthogonal mountain silhouettes, decide whether any solid casts both and print the largest possible volume modulo 1000000007.Hard9GeometryMath+2No attempts yet2s256 MBJudgeable
Largest and Smallest TriangleGiven n points in the plane, compute the largest and smallest areas among all triangles formed by triples of the points.Hard9GeometrySorting+1No attempts yet6s128 MBJudgeable
Chain & Co.Decide whether axis-aligned square links split into two nonempty groups with every cross pair linked.Hard9GeometryGraph+1No attempts yet10s128 MBJudgeable
Green EnergyPlace towers of given heights on a polygonal terrain to maximize the total length lit by parallel sun rays blocked by terrain and other towers.Hard9GeometryGreedy+1No attempts yet1s128 MBJudgeable
GRADCities join the road network one by one with two roads each, and each query asks the shortest road distance between two cities.Hard9Shortest pathGraph+2No attempts yet2s256 MBJudgeable
OrbitPlace two opposite sensors on the radius-R circle so their brightest-star readings match, and print the pair with the smallest angle.Hard9GeometryMath+1No attempts yet2s256 MBJudgeable
Bisecting the IslandSplit an axis-parallel simple polygon into two congruent pieces with one axis-parallel cut on integer coordinates, or report that none exists.Hard9GeometryBrute forceNo attempts yet1s256 MBJudgeable
The Forest of FangornFind which border camps connect to the start by a path where no tree ever hides behind another tree.Hard9GeometryGraphNo attempts yet3s64 MBJudgeable
Solar LampsCompute each lamp turn-on time from its place in the power-on order and the count of already lit lamps shining on it.Hard9GeometrySegment tree+1No attempts yet1s256 MBJudgeable
ParkingDecide whether axis-aligned cars in a strip of height w can be slid without overlap or rotation from the start layout to the target layout.Hard9GeometryGraph+2No attempts yet3s256 MBJudgeable
MuseumA burglar picks guards to bribe to maximize the value of exhibits no remaining guard sees minus bribe costs under downward cone views.Hard9GraphGeometry+1No attempts yet1s256 MBJudgeable
Watering the Bean PlantsPlace at most one disk of radius R and cover the uncovered parts of N segments with unit-length sticks at minimum total cost.Hard9GeometryGreedy+1No attempts yet10s256 MBJudgeable
Art GalleryFind the vertex sequence of the shortest interior path between two given vertices of a polygon lit from edge v0-v1.Hard9GeometryShortest pathNo attempts yet1s256 MBJudgeable
Random signalsCompute the expected plane integral of the strongest covering signal when each of up to 20 stations draws an independent uniform power that activates its disks.Hard9GeometryProbability+1No attempts yet12s256 MBJudgeable
Development of Small Flying RobotsEach robot moves sideways for 1 energy and rises through a hole for 100, and all must meet on one hole-free cell of the top floor for the least total energy.Hard9Shortest pathGraph+1No attempts yet1s256 MBJudgeable
Canyon MappingCover a simple polygon with k equal axis-aligned squares and print the smallest side length that covers it, rounded to two decimals.Hard9GeometryBinary search+1No attempts yet1s256 MBJudgeable
Balancing LineFind the shortest closed curve avoiding square lamp footprints that encloses a nonempty lamp group holding half the total energy.Hard9GeometryBrute force+1No attempts yet10s256 MBJudgeable
KernelDecide whether a rectilinear polygon contains a beacon point that attracts every other point under greedy distance-decreasing motion.Hard9GeometryNo attempts yet1s256 MBJudgeable
Highways and CountiesFind the smallest road length limit so cities joined by shorter roads form a group whose populations hold a subset summing to a multiple of K.Hard9Minimum spanning treeDynamic programming+2No attempts yet2s64 MBJudgeable
Runner and SniperYou give your start position and the gun's start angle and turn rate, then compute the fastest run speed at which the rotating gun still catches you.Hard9Game theoryGeometry+1No attempts yet2s256 MBJudgeable
Rotating Cutter BitsThe program counts interior lattice points of a polygonal workpiece that survive one full rotation against a second rotating polygonal cutter.Hard9GeometrySimulation+1No attempts yet3s256 MBJudgeable
Lights Out in the BarnStarting at an unknown vertex of a rectilinear barn, walk the walls to identify the position and reach the exit with the smallest worst-case extra distance.Hard9Dynamic programmingGame theory+1No attempts yet2s512 MBJudgeable
Twirling Towards Freedom (Large)Each minute you stay put or rotate 90 degrees clockwise around a star, and must report the largest squared distance from the origin reachable in M minutes.Hard9GeometryNumber theory+2No attempts yet5s512 MBJudgeable
Ninjutsu (Large)Pick a starting rope length so the counterclockwise swing catches as many targets as possible before settling into orbit.Hard9GeometryDynamic programming+1No attempts yet60s512 MBJudgeable
Watering Plants (Large)Given non-overlapping plant disks, find the smallest radius R so that two disks of radius R together cover every plant disk completely.Hard9GeometryBinary search+2No attempts yet60s512 MBJudgeable
Polygonal PuzzleGiven two simple polygons, translate and rotate them without reflection so their interiors stay disjoint and their shared boundary is as long as possible; print that maximum length.Hard9GeometryBrute force+2No attempts yet20s512 MBJudgeable
Road TimesGiven a unique shortest route for each ordered city pair, recorded delivery times constrain 30 to 60 km/h road speeds; for each query find the minimum and maximum travel time consistent with all records.Hard9Shortest pathMath+2No attempts yet5s512 MBJudgeable
Spin DoctorGiven n points (a_i, b_i) labeled 1 or 0, choose a direction (S, T); with ties broken adversarially, minimize the span covering all label-1 points.Hard9GeometrySorting+2No attempts yet5s512 MBJudgeable
Connect HighwaysGiven two planar connected networks, find the Red-Blue junction pair allowed to be joined by a segment, following a fixed angular tie-breaking rule.Hard9GeometrySorting+2No attempts yet0.4s32 MBJudgeable
Covering postersFor each new axis-aligned rectangle, compute the total area of the given union of rectangles that it covers.Hard9Segment treePrefix sum+2No attempts yet2s1024 MBJudgeable
Half-plane land grab 2Maintain a dynamic set of lines under insertions and deletions and answer maximum-at-x queries online.Hard9Dynamic programmingDivide and conquer+2No attempts yet4s512 MBJudgeable
New TrackConstruct a fixed alternating axis-parallel polyline through a formula that encodes exactly k crossings, using a zigzag permutation of y coordinates to place them.Hard9ImplementationCombinatorics+2No attempts yet2s512 MBJudgeable
Flowey's LoveA soul starting at the origin moves at speed at most 1 inside a rectangle; N moving points travel along fixed lines, and you must find the maximum number of points the soul can touch.Hard9GeometryDynamic programming+2No attempts yet1s512 MBJudgeable
PostersCompute the visible area of each of N rectangles pasted in order on the plane, where later rectangles cover earlier ones.Hard9GeometryDivide and conquer+2No attempts yet2s512 MBJudgeable
Laser SensorsGiven N blue points and 2N red points in general position, build the particular non-crossing perfect matching prescribed by the paper's recursive angular-sweep Solve/Attach procedure.Hard9Divide and conquerGeometry+2No attempts yet2s512 MBJudgeable
Distant StarsEach star moves at constant integer velocity; for each day 0 to T find the maximum pairwise squared distance, and report the earliest day attaining the minimum of that maximum.Hard9GeometryDivide and conquer+2No attempts yet2s512 MBJudgeable
Counting points inside a circleFor each of M circle queries, count how many of N fixed points lie inside or on the circle, printing the count per query.Hard9GeometryDivide and conquer+2No attempts yet8s512 MBJudgeable
Polygon Shrinking KitEach polygon vertex is replaced by the midpoint toward A or toward B; among all choices keeping the vertices in convex order, find the minimum possible area.Hard9GeometryDynamic programming+2No attempts yet1s512 MBJudgeable
Appropriate Coordinate MapGiven N points, choose a ring through all of them and endpoints A, B so the two legs are monotone in the projection onto AB, maximizing the smallest gap in that projection.Hard9GeometryGreedy+1No attempts yet5s512 MBJudgeable
Jumping ImpalaGiven a lake, a central island, and S unit rocks, find the minimum leap distance letting Vlad reach the island and return twice without landing on any rock twice.Hard9Binary searchGraph+2No attempts yet8s512 MBJudgeable
Blue ForestGiven several planar floor maps that may be rigid-motion duplicates, unify matching maps, merge their warp gates, then find the shortest route from entrance to exit.Hard9GeometryGraph+2No attempts yet8s512 MBJudgeable
EggscavationGiven up to 100000 shell species (each in at most 4 cells) and egg insertions, answer queries for the probability that a random K x K scoop covers at least V species and no egg.Hard9GeometryPrefix sum+2No attempts yet10s512 MBJudgeable
MinerFor each lamp position above a polyline mine floor, find the reachable floor interval lit without crossing the floor.Hard9GeometryBinary search+2No attempts yet1.5s512 MBJudgeable
Rolling the BottleGiven a convex polygon as a bottle base and a water volume, find the minimum and maximum number of sides of the water region as the bottle rolls.Hard9GeometrySorting+2No attempts yet2.5s512 MBJudgeable
Omnicircumnavigation (Large)Given points on a unit sphere joined in order by shortest arcs, decide whether the closed path meets every great circle.Hard9GeometryMath+2No attempts yet120s512 MBJudgeable
Equivalent DeformationGiven two equal-area triangles, find the minimum number of vertex-sliding operations that map the first exactly onto the second.Hard9GeometryImplementation+2No attempts yet2s512 MBJudgeable
Arranging tilesGiven up to 14 convex tiles of equal height with cut corners, find the ordering and horizontal placement that minimizes the total frame width when packed side by side.Hard9Dynamic programmingGeometry+2No attempts yet1s1024 MBJudgeable
CratersFind the shortest single closed fence that surrounds all circles at distance 10 or more, given each crater's center and radius.Hard9GeometryDynamic programming+2No attempts yet2s512 MBJudgeable
SkiingFind the shortest polygonal path from S down to F that crosses n horizontal gates in top-to-bottom order, and output its breakpoints.Hard9GeometryGreedy+2No attempts yet1s1024 MBJudgeable
Lunar LandscapeCompute the total area covered by axis-aligned squares and 45-degree rotated squares, counting overlaps once.Hard9GeometrySorting+1No attempts yet2s512 MBJudgeable
Secret AgentGiven a planar straight-line graph (castle walls) where crossing a wall costs its height, find the minimum cost to travel between successive query points, starting from infinity.Hard9GraphGeometry+2No attempts yet2s512 MBJudgeable
Maximal polygon brightnessGiven a convex polygon and a sequence of vertex deletions, compute after each deletion the largest total length of edges that a single external light point can illuminate.Hard9GeometryDynamic programming+2No attempts yet3s1024 MBJudgeable
Circle SelectionProcess circles in decreasing radius order; each chosen circle removes all remaining circles that intersect it, and for every circle you must report which chosen circle eliminated it.Hard9GeometrySorting+2No attempts yet3s1024 MBJudgeable
United States of EurasiaSplit N points sorted by x into at most K contiguous groups, minimizing the largest squared diameter within any group.Hard9Binary searchDynamic programming+2No attempts yet20s1024 MBJudgeable