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 results2,732 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| IvoizationSum the Ivoization values of every K by K submatrix, where Ivoization is the pairwise absolute-difference sum of all K^2 entries, modulo 10007. | Hard8 | SortingPrefix sum+2 | No attempts yet | 1.5s | 128 MB | Judgeable |
| ZvonimirFind the minimum number of operations (type one letter, or copy a contiguous block of already typed text and append it) to produce string X. | Hard8 | Dynamic programmingString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Median filterGiven a piecewise-linear integer signal by its corner points, output the corners of its median-filtered signal of width 2d+1. | Hard8 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangle regionsGiven N points with no three collinear, count for each v how many triangles formed by three points contain exactly v other points strictly inside. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Reconstruct the progressionsGiven K listed values in [A,B], find the smallest set of positive step sizes whose multiples in [A,B] hit exactly those values. | Hard8 | Number theoryMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| I Teach SweepingGiven segments in the first quadrant, find a line through the origin that intersects the most segments and report that count. | Hard8 | GeometrySorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Cutting edges one at a timeDelete edges of a weighted undirected graph one by one so that the total weight removed before s and t get disconnected is as large as possible. | Hard8 | GraphMinimum spanning tree+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Sorting Array (Large)Given a permutation of 1..N and a limit P, partition it into contiguous blocks, sort each, then reorder at most P blocks by swaps; maximize the number of blocks. | Hard8 | GreedySorting+2 | No attempts yet | 30s | 512 MB | Judgeable |
| Stretch Rope (Large)Given N rubber bands with stretch ranges [A_i, B_i] and prices, pick a subset whose summed range contains L at minimum total cost within budget M. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 30s | 512 MB | Judgeable |
| Rides 1Each day one child grows by 1 cm; after each growth, count how many of Q given pairs (i,j) can ride their specified ride, where the pair's combined height meets the ride's limit. | Hard8 | SortingBinary search+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Why Did the Cow Cross the Road 11Given a permutation of breeds on each side of a road, connect pairs whose breed numbers differ by at most 4 using non-crossing edges, maximizing the count. | Hard8 | Dynamic programmingDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Sequence and Queries 18Maintain an array under point updates and answer range queries counting elements greater than k. | Hard8 | Segment treeSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Pieces of ParenthesesGiven n pieces of parentheses, choose and order some pieces to build the longest balanced parenthesis string. | Hard8 | Dynamic programmingGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Blazing New TrailsChoose a spanning tree of a graph whose edges each join a marked or unmarked vertex, with exactly w marked-unmarked edges, minimizing total cost. | Hard8 | Minimum spanning treeGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Taking Balls from Three BasketsCount triples of baskets (chosen from N) where the second player wins the subtraction game on three piles with move limit M. | Hard8 | Game theoryCombinatorics+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Study GroupGiven students with skill values and sets of known algorithms, pick a group whose skill range is at most D to maximize (union size minus intersection size) times group size. | Hard8 | Bit manipulationSliding window+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Heaven's KitchenChoose match order and winners so a knockout tournament maximizes summed floor((Ci+Cj)/|Pi-Pj|), then output the unique bracket fixed by the stated tie-breaking rules. | Hard8 | Minimum spanning treeUnion-find+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Weather ForecastMaintain N snow depths under point increments and decrements, then answer range-count queries (depth between L and R) and T-th largest value queries online. | Hard8 | Segment treeBinary search+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Toppling Dominoes (Small)Sort the dominoes by position and find the minimum number of manual pushes so that chains topple every domino. | Hard8 | Dynamic programmingSorting+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Dominoes (Large)Find the fewest pushes (each a domino plus a direction) needed to topple every domino through chain reactions. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Segment Friends (Large)Given N segments on a line, build the intersection graph and answer Q shortest-path queries between segment pairs, or report -1. | Hard8 | GraphBFS+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Over Fitting (Large)Given N labeled points in the plane, find a line whose positive half-plane contains only LOVELYZ points and maximizes how many LOVELYZ points it captures. | Hard8 | GeometrySorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Space ExplorationGiven N segment obstacles in the first quadrant and M rays from the origin, count how many segments no ray intersects, including exact endpoint touches. | Hard8 | GeometrySorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Money for NothingPick one producer and one consumer to maximize (q-p)(e-d) over pairs where q>p and e>d, with up to 500000 of each. | Hard8 | Divide and conquerGeometry+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Visual Python++Match n top-left corners to n bottom-right corners so the rectangles form properly nested or disjoint blocks, or report a syntax error. | Hard8 | SortingStack+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Electronic devicesAssign distinct power supplies to components so every device i gets at least Y_i working components, with a supply's chosen power matching the component's exact requirement, and output the lexicographically smallest connection list. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Strange Solutions at Jeong LabGiven a growing set of (A,B) pairs, decide each day whether the new pair is dominated by or lies on the segment between two existing points. | Hard8 | GeometryBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Leftmost SegmentGiven n segments spanning two horizontal lines, answer m queries asking which segment meets a horizontal line at the leftmost point, breaking ties by the upper endpoint. | Hard8 | SortingBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Map LabelingPlace disjoint unit-height labels on a line above given points and count the minimum number of connectors that cannot run straight down to their own label. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Card Operation (Large)Order a set of arithmetic cards applied to a starting value to maximize the final rational result, printed as a reduced fraction. | Hard8 | GreedySorting+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Cups and MarblesAfter m range-sort spells (ascending or descending) on a permutation, report the marble in the middle cup. | Hard8 | Binary searchSorting+2 | No attempts yet | 4s | 256 MB | Judgeable |
| Standing in lineGiven a partial order of comparisons between students in line, recover a card permutation consistent with all pairs or print -1. | Hard8 | Topological sortSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Permutation SwapsFor each k from 1 to n-1, count permutations reachable from A in exactly k swaps, modulo 1e9+7. | Hard8 | CombinatoricsDynamic programming+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Rectilinear RegionsGiven two unbounded staircase polylines L and U, count the closed regions they enclose with L below and U above, and sum their areas. | Hard8 | GeometryTwo pointers+2 | No attempts yet | 0.5s | 512 MB | Judgeable |
| Sheets and PaintballsGiven axis-aligned rectangles and colored points, count the distinct color labels that reach each rectangle along the vertical stacking order. | Hard8 | SortingSegment tree+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Compass Card SalesRepeatedly remove the remaining card with the smallest uniqueness score, breaking ties by larger ID, and print the removal order. | Hard8 | SimulationSorting+2 | No attempts yet | 6s | 512 MB | Judgeable |
| HubtownAssign citizens to one of their two angularly nearest train rays, respecting each ray's capacity, and maximize the number assigned. | Hard8 | GreedySorting+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Daunting deviceApply N range-recolor operations whose endpoints depend on the current count of a query color, then report the highest cell frequency. | Hard8 | Segment treeImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| The Uncertainty of PoliticsEach hearing has a start time and a uniform integer length in [a,b]; pick hearings to attend fully so the expected count is maximized. | Hard8 | Dynamic programmingProbability+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Avoiding AirportsFind a flight itinerary from country 1 to country n minimizing the sum of squared waiting times at airports. | Hard8 | GraphShortest path+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Graphics DesignSimulate discrete events where students claim cameras, camcorders, and computers for subprojects in priority order and report each student's finish time. | Hard8 | SimulationHeap+2 | No attempts yet | 4s | 512 MB | Judgeable |
| Power plantsColor n points with two colors so the closest same-color pair is as far apart as possible, and output that squared distance plus the lexicographically smallest optimal coloring. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 3s | 1024 MB | Judgeable |
| Corporate life after a hostile takeoverGiven two rooted trees on the same n employees, count for each employee how many others are descendants in both trees. | Hard8 | TreeDFS+2 | No attempts yet | 0.5s | 1024 MB | Judgeable |
| Posters on the wallGiven up to 50000 non-overlapping axis-aligned rectangles, answer online queries that ask for the total rectangle area inside a query rectangle, with coordinates decoded from the previous answer. | Hard8 | Segment treeSorting+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| RacetrackGiven ordered lap times and lap counts and the rule that passes happen only at the finish line, compute when each runner finishes the race. | Hard8 | SimulationImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| WolfGiven your n-card pile and the opponent's remaining 51... wait 52-n cards, decide whether reordering both piles can make you win the next turn. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Buffalo BarricadesFor each settler arriving in order, count the buffalos inside the region bounded by rivers and fences whose upper right corner is the settler's post. | Hard8 | SortingPrefix sum+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Archery TournamentMaintain a dynamic set of non-overlapping circles tangent to the ground, support insertions and point queries that remove the hit circle, and report which circle each arrow hits. | Hard8 | GeometryBinary search+2 | No attempts yet | 3s | 512 MB | Judgeable |
| The Great WallEach design picks two length-r intervals whose overlap height adds extra cost; find the k-th smallest total wall height over all interval pairs. | Hard8 | Binary searchPrefix sum+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Fence InvasionCount how many distinct convex polygons can be formed as the convex hull of some subset of at least 3 of the given points, modulo 1e9+7. | Hard8 | GeometryCombinatorics+2 | No attempts yet | 5s | 512 MB | Judgeable |
| The Infosci Pirate CrewGiven N islands with coordinates, treasure values, and safe hardness, choose a monotone northeast path and a hardness interval to maximize collected value minus interval length. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Making the Perimeter of the Convex Hull ShortestGiven n points, find the largest decrease in convex hull perimeter achievable by removing exactly two of the points. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Starting a Scenic Railroad ServiceFor n travel segments, compute the minimum seats needed under arbitrary online seat choices and under optimal offline assignment. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Border WallGiven two colored point sets and a width d, find the minimum number of points to delete so that a strip of width d separates the remaining points by color. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Homotopic PathsDecide whether two polygonal paths from s to t in a plane with point obstacles are homotopic, that is, deformable into each other without crossing any tree. | Hard8 | GeometryImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Balloon DistributionRank all ratios P_i/j from largest to smallest and count, for each contestant, how many ratios fall at rank N or above, with ties at the cutoff all counted. | Hard8 | Binary searchSorting+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Convex QuadrilateralGiven n points, find the smallest-area convex quadrilateral whose four sides each pass through at least two of the points and that contains every point. | Hard8 | GeometryGreedy+2 | No attempts yet | 9s | 512 MB | Judgeable |
| Christmas TreeGiven the final colours on a tree after M path-painting updates with distinct colours, reconstruct the unique valid update order and the endpoints of each colour's shortest covering path. | Hard8 | TreeDFS+2 | No attempts yet | 0.7s | 512 MB | Judgeable |
| Binary TransformationsGiven starting bits, target bits, and per-bit costs, flipping a bit i costs the sum of costs of all bits equal to 1 after the flip; find the minimum total price to reach the target. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Blowing CandlesGiven up to 200,000 points inside a disk, find the minimum width of a strip that can cover all of them. | Hard8 | GeometryBrute force+2 | No attempts yet | 4s | 512 MB | Judgeable |
| Vera and the BanquetGiven a circular string S, count the number of distinct substrings appearing in any contiguous block read in either direction around the circle. | Hard8 | StringString matching+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Vera and Canada DayAfter each laser is added, choose one of four L-shaped firing orientations per laser so that the total awe from lasers hit by beams is maximized. | Hard8 | Dynamic programmingGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Computer ScienceFind the smallest L such that for each a_i we can pick an interval [x_i, x_i+L] covering a_i and containing at least K of the given integers. | Hard8 | Binary searchSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Standing Out from the HerdFor each name in the herd, count its substrings that occur in no other name. | Hard8 | StringString matching+2 | No attempts yet | 2s | 512 MB | Judgeable |
| A Pie for a PieEach cow alternately returns a pie whose own tastiness is within D above the received pie; for each of Bessie's pies, find the fewest pies in an exchange ending with a zero-valued pie. | Hard8 | GraphBFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Arranging game levelsCount rooted tree arrangements of N levels where each level's clear score S_i and the cumulative score K_i along the root-to-level path are given, and children must have larger S than parents. | Hard8 | TreeCombinatorics+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Escape from HellChoose an order to use N energy drinks so the climber reaches length L on the earliest day without sinners catching up at night. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Share the Ruins PreservationSplit points by a vertical line that avoids all points, build the minimum-area enclosing convex hull of each side, and minimize the total area. | Hard8 | GeometrySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Frogs 2Assign one frog to each pad so that every frog sits on a preferred pad and each log joins two frogs with equal interest in the log's topic. | Hard8 | GraphBacktracking+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Lifeguards (Platinum)Fire exactly K of N lifeguard shifts to maximize the total time covered by at least one remaining shift. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Ascending PhotoGiven a sequence of n heights, find the minimum number of cuts so the pieces can be reordered into a nondecreasing sequence. | Hard8 | GreedySorting+2 | No attempts yet | 3s | 512 MB | Judgeable |
| PetrolGiven a weighted graph with some marked stations, answer queries asking whether a tanker of capacity b can travel from station x to station y, refuelling only at stations. | Hard8 | GraphShortest path+2 | No attempts yet | 2s | 512 MB | Judgeable |
| The StagingGiven n gangsters each aiming at a distinct target, count survivors after each of q updates to the shooting time of one gangster. | Hard8 | GraphDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Spacetime StoneAssign Taekhee's cards to rounds and pick a strength-joker round so that Namgyu's best-case score (over his joker round) is minimized, ties broken lexicographically. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Catch the PlaneChoose an adaptive strategy of buses to maximize the probability of reaching station 1 by time k, where each bus runs independently with a known probability. | Hard8 | Dynamic programmingProbability+2 | No attempts yet | 10s | 1024 MB | Judgeable |
| 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. | Hard8 | GeometrySorting+2 | No attempts yet | 6s | 1024 MB | Judgeable |
| Wireless Instead of FiberGiven a connected multigraph, output a spanning tree minimizing the number of vertices whose degree differs from the original, following a prescribed construction procedure. | Hard8 | GraphGreedy+2 | No attempts yet | 2s | 1024 MB | Judgeable |
| SlingshotFor each of M queries (a, b), find the minimum time to move manure from a to b using the tractor (cost equals distance) plus at most one slingshot that flies from x to y in time t. | Hard8 | Divide and conquerSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Snow BootsFor each of B boots with limits on snow depth and step length, decide whether the farmer can walk from tile 1 to tile N, landing only on tiles whose snow is shallow enough. | Hard8 | Binary searchSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Out of SortsGiven an array, simulate a hybrid of quicksort and bubble sort that repeatedly bubbles until partition points appear, then splits, and report the total work counter. | Hard8 | SortingSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| DisruptionGiven a tree and extra weighted edges, for each tree edge report the minimum weight of a non-tree edge whose endpoints lie in different components after removing it. | Hard8 | TreeDFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Out of SortsGiven an array, count how many times the outer loop of a forward-backward bubble sort variant runs before the array becomes sorted. | Hard8 | SortingMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| RecipeBuy ingredients on some days, hold each in the fridge until a later day, cook it there if freshness stays at least L_i, and maximize the total of F_i minus elapsed days times C_j; print Impossible if day N can't be a cooking day. | Hard8 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| ParticlesGiven firing times and speeds of N particles from each of two facing accelerators, report the first K collisions between opposite kinds in chronological order. | Hard8 | SortingTwo pointers+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Travelling Businessmen ProblemGiven a connected undirected graph with mutable node values, answer queries asking the minimum possible difference between the values of two walkers' end cities. | Hard8 | GraphBFS+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Make a ForestGiven N weighted tuples (u,v,w) with distinct weights, build a forest realizing each tuple as a parent-child edge so that every internal node's parent edge is smaller than all its child edges, each node has at most M children, and the number of trees is minimized. Output that minimum tree count. | Hard8 | GraphUnion-find+2 | No attempts yet | 2s | 512 MB | Judgeable |
| XEN 3166Assign each country a length-K subsequence starting with its first letter so that code order matches name lexicographic order, or report impossible. | Hard8 | GreedyString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| PermutationGiven a permutation P and queries K, find the exponent T such that P^T is the K-th smallest among P^1 through P^(M-1) in lexicographic order. | Hard8 | MathCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| CitationsOrder the reading of a citation tree rooted at book 1 so that the sum of all book return times is minimized. | Hard8 | TreeGreedy+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Mysterious ArrayCount permutations of 1..N consistent with Q range-minimum constraints, modulo 1e9+7, with contradictions giving 0. | Hard8 | CombinatoricsSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Matrix MultiplicationFor each prefix of n matrices, decide whether some multiplication order is valid, and if so report the largest possible area of the final product. | Hard8 | GreedySorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Harmonious MatrixGiven a 2xN or 3xN matrix of distinct integers, find the largest subset of columns whose orderings within each row are identical, and report its column count. | Hard8 | SortingHash map+2 | No attempts yet | 5s | 768 MB | Judgeable |
| Magnet ToyGiven a simple graph, decide whether its vertices can be removed one by one so that each removed vertex's remaining neighbors form a clique, and output the order if possible. | Hard8 | GraphImplementation+2 | No attempts yet | 1.5s | 256 MB | Judgeable |
| 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. | Hard8 | GeometrySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Zoning HousesFor each query range of houses, find the side length of the smallest axis-aligned square covering all points in the range, with the option to drop one point. | Hard8 | Segment treeDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Монгол ардын үлгэрChoose a subset whose size is at most the total weight of the remaining stones, maximizing the value of that chosen subset. | Hard8 | Dynamic programmingSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| 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. | Hard8 | GeometrySorting+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Grievous Loss of DataGiven the clash graph of N interval lectures, find the minimum number of halls, which equals the chromatic number guaranteed realizable by intervals. | Hard8 | GraphIntervals+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Injecting DNAFor every suffix of a string, compute its toxicity from the number of out-of-order suffix pairs, then output the length of the suffix with the largest effectiveness. | Hard8 | StringSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |