Curated sets
Interview core
The mediums that show up in real onsite loops.
Total results1,547 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| The Die Is CastRead a pixel image, split non-background pixels into dice connected by shared edges, count the dot regions inside each die, and print the counts sorted. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Spiderman's WorkoutAssign plus or minus signs to the distances so the partial sums stay at or above 0 and return to 0 at the end, minimizing the peak height. | Medium5 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tournament RankingGiven game results between teams, produce the lexicographically smallest topological order, or report that no valid ranking exists due to a cycle. | Medium5 | GraphTopological sort+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Traffic PlanningGiven a directed graph and a start node, list the nodes not reachable from the start by a path of one or more edges; print OK if none. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Median Weight BeadGiven weighted comparisons between beads, count how many beads cannot be the median because at least (N+1)/2 beads are known heavier or lighter. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Alice Through the Looking GlassGiven a magnification level and a cell coordinate, decide whether that cell of the 5^m by 5^m self-similar grid is filled or empty. | Medium5 | RecursionDivide and conquer+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Putnam Rank RangeGiven the average rank for each distinct score, find the rank range occupied by the block of contestants holding your score. | Medium5 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Spies Like UsGiven a bipartite graph, decide whether any two vertices on the same side share at most one common neighbor on the other side. | Medium5 | GraphHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Barking Dogs!Given dogs with wake-up delays and a directed hearing graph, simulate who barks each second from 0 to T and count each dog's barks. | Medium5 | SimulationGraph+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ShuffleGiven a permutation of 27 characters, apply it N times to a short string and print the result. | Medium5 | ImplementationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| CN TowerGiven angles of landmarks around a rotating restaurant that turns 360 degrees every 72 minutes, find the shortest time window covering all distinct angles. | Medium5 | SortingTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BananasDecide for each word whether it fits the recursive grammar of a monkey language, where words wrap other words in N and in B...S. | Medium5 | StringRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pinball RankingGiven scores in play order, compute each game's rank as one plus the number of earlier-or-later scores strictly above it, then output the average rank as a reduced fraction. | Medium5 | Binary searchSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SpreadsheetEvaluate each spreadsheet cell, treating formula cells as sums of other cells, and mark any cell involved in a dependency cycle as undefined. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ScribbleGiven seven tiles with letter values and a dictionary of up to 100000 words, find the highest-scoring dictionary word formable from the tiles, or 0 if none is. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CookiesGiven up to 10 points, find the diameter of the smallest enclosing circle. | Medium5 | GeometryBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SubsetsGiven inequalities where a set name contains either an element or another set name, find each named set's minimal required elements. | Medium5 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pattern GeneratorFor each (n, k) pair, print all n-bit strings with exactly k ones in decreasing numeric order, separated by blank lines. | Medium5 | BacktrackingRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| All Roads Lead Where?Given a tree of cities rooted at Rome and query pairs, print the unique shortest path between each pair as the first letters of the cities on the route. | Medium5 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tree CuttingOn a tree of N nodes, print every node whose removal leaves each connected piece with at most floor(N/2) nodes, or NONE. | Medium5 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Journey of a KnightGiven an n by m board, find the minimum number of knight moves from cell (1,1) to cell (i,j), or report that it is unreachable. | Medium5 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GearsCount how many distinct fractions a/b exist with both a and b in the range M to N. | Medium5 | MathNumber theory+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Tax SystemEach client's income is taxed through N progressive brackets with given widths and rates; compute the total tax for M clients, printed to two decimals. | Medium5 | Prefix sumBinary search+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| MõttemeisterGiven several guesses and their correct-digit counts A and position counts B, list every 4-digit secret number consistent with all clues. | Medium5 | Brute forceImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| TähekabeOn an N x N letter grid, decide for each of up to 10 query words whether a simple path from the start cell spells it, without reusing a cell. | Medium5 | BacktrackingDFS+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Go-KartFind the smallest fuel-tank capacity that lets a kart refuel at given stations and travel at least K kilometers. | Medium5 | Binary searchGreedy+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Sawtooth SequenceGiven N distinct numbers, arrange all of them into a zigzag sequence and output the lexicographically smallest such arrangement. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| AnimalsGiven N daily active intervals, some crossing midnight, find whether all overlap at some moment and output the longest common sub-interval. | Medium5 | IntervalsImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| CourierSimulate orders arriving over time: assign each to the free courier who delivers fastest, or drop it if all couriers are busy, and total each courier's earnings. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| ChocolateGiven an M by N grid of labels, decide whether every label occupies exactly one solid axis-aligned rectangle. | Medium5 | MatrixImplementation+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Spacecraft MalfunctionGiven each unit's check reports on two others, exactly one faulty unit, and a faulty unit may lie, find the unique faulty unit or print impossible. | Medium5 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parentheses Encoding ConversionGiven the P-sequence encoding of a well-formed parenthesis string, compute its W-sequence encoding. | Medium5 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Wooden SticksGiven n sticks with length and weight, order them to minimize the number of setup steps, where a setup is needed unless both length and weight are nondecreasing from the previous stick. | Medium5 | SortingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Repeated Permutation CipherGiven a permutation key and a repeat count k, apply the permutation to each padded message k times and print the result. | Medium5 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Card Game CheaterEve knows Adam's card order and must permute her own cards to maximize the number of positions where her card beats his. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| InvestmentStarting capital grows over at most 40 years by rebuying a portfolio of bonds each year; maximize the final amount. | Medium5 | Dynamic programmingGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| 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. | Medium5 | GeometryBinary search+2 | No attempts yet | 2s | 128 MB | Judgeable |
| DivisibilityGiven a sequence and a modulus K, decide whether some choice of + or - before each later element makes the total divisible by K. | Medium5 | Dynamic programmingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| False CoinGiven recorded balance weighings of N coins with exactly one false coin, output the coin number if the results identify it uniquely, otherwise 0. | Medium5 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Spell CheckerGiven a dictionary and query words, mark each query correct, or list dictionary words reachable by one deletion, replacement, or insertion. | Medium5 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bin PackingPack items into identical bins holding at most two items each so that the number of bins is minimized. | Medium5 | GreedyTwo pointers+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DancersRepeatedly pair the two closest unpaired dancers, breaking ties by smaller indices, and output all pairs sorted. | Medium5 | SortingGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Playground HideoutGiven a directed graph with weighted edges and direct ground costs per node, find the index of the node with the largest shortest-path distance from ground, breaking ties by smallest index. | Medium5 | Shortest pathGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Olympic GamesGiven each event's date and start and end times in hhmm, find the maximum number of events a person can attend without overlap, moving freely between venues. | Medium5 | GreedySorting+2 | No attempts yet | 2s | 256 MB | Judgeable |
| RelocationSplit up to 10 furniture items between two cars with capacity limits so that every item gets moved in the fewest number of paired trips. | Medium5 | Dynamic programmingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Number TricksFor each query, count the trailing zeros of n! in base b by factoring b and finding the minimum over primes of each exponent's count in n!. | Medium5 | Number theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Betting SetsPartition an N by M table of probabilities into groups of one cell per column to maximize the expected number of all-heads groups. | Medium5 | Dynamic programmingBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Polling StationsGiven an undirected graph, find the smallest set of vertices such that every edge touches at least one chosen vertex. | Medium5 | GraphGreedy | No attempts yet | 1s | 64 MB | Judgeable |
| 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. | Medium5 | GeometryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| OutletsGiven power strips that swap between standard A and B outlets, find the maximum number of standard-A outlets that can end up powering computers. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Digit Sum Over a RangeGiven l and u up to 2e9, find the total of the digit sums of every integer in that inclusive range. | Medium5 | MathDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Avoiding Financial NightmareGiven a loan principal, a term in months, and a monthly interest rate, find the fixed monthly payment so the balance hits zero at term end. | Medium5 | Binary searchSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| No Pause TelegraphGiven a string of dots and dashes and seven fixed letter codes, split it into codewords that minimize the resulting message alphabetically, or report that no split exists. | Medium5 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Romantic DateGiven Wibowo's 26 cards, find the maximum number of rounds he can win by pairing his cards against his opponent's 26 cards in the best order. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Nearest number - 2Replace each zero with the nearest nonzero value using Manhattan distance, but leave zeros that are tied between two or more nearest values unchanged. | Medium5 | BFSGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PearlsGiven demand and price per pearl for classes in increasing quality order, find the cheapest way to buy all pearls when each class's order may be upgraded to a higher class, paying 10 extra pearls' worth per purchase. | Medium5 | Dynamic programmingPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cash DispenserCount 4-digit PINs whose digits appear as a subsequence of every recorded finger-movement sequence. | Medium5 | StringDynamic programming+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Piggy BanksEach key i sits in some bank; opening a bank frees its keys. Find the minimum number of banks to smash to reach all N banks. | Medium5 | GraphDFS+2 | No attempts yet | 3s | 128 MB | Judgeable |
| InsulatorGiven n positive coefficients, reorder them so that the sum plus the total of positive rises between adjacent layers is as large as possible, and print that maximum. | Medium5 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ProtocolsCount the length-m strings over k symbols with no run of l equal symbols, then output floor((n/m) * log2(count)). | Medium5 | Dynamic programmingCombinatorics+2 | No attempts yet | 3s | 128 MB | Judgeable |
| BalanceGiven weights, split some into two equal-sum disjoint groups; find the largest weight that can be the heaviest used one. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 3s | 128 MB | Judgeable |
| RepetitionsGiven up to five lowercase words of length at most 2000, find the length of the longest substring that appears as a contiguous fragment in every word. | Medium5 | StringBinary search+2 | No attempts yet | 3s | 128 MB | Judgeable |
| PromotionEach day, receipts are added to a box, then the largest and smallest are removed and the difference is paid out; find the total payout. | Medium5 | HeapImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Monochromatic TrianglesGiven n points and a list of red edges (all other pairs are black), count the triangles whose three sides share one color. | Medium5 | CombinatoricsGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| OrienteeringGiven the cyclic sequence of stage difficulties around a loop, decide whether some starting point and direction make the difficulties non-increasing. | Medium5 | ArrayGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Logarithmic PaprikaGiven counts of paprika weighing 1, 2, 4, ..., 2^k grams, find the smallest positive weight that cannot be formed from whole pieces. | Medium5 | GreedyMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Apples and Apple TreesGiven positions of n trees and m apples on a line, find the minimum distance from any apple to its nearest tree. | Medium5 | SortingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| LibraryMerge n files two at a time, where each merge costs the sum of the two lengths, and minimize the total cost. | Medium5 | GreedyHeap | No attempts yet | 1s | 128 MB | Judgeable |
| Crime at Piccadilly CircusFor each integer moment in [p, k], count how many people's inclusive intervals cover it, and report the minimum and maximum counts. | Medium5 | IntervalsSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Galactic Container ShipGiven M rails with height limits 1..M and N plates each worth its quality w and having height h, choose plates to maximize total quality so that each chosen plate fits some distinct rail. | Medium5 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| HighwaysFind a spanning tree of a connected weighted graph that minimizes the maximum edge weight, and report that weight. | Medium5 | Minimum spanning treeGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Two WordsAfter each swap of one character between the two strings, report which string is lexicographically larger. | Medium5 | Segment treeString | No attempts yet | 1s | 512 MB | Judgeable |
| The TravelerCompute the height and width of the smallest axis-aligned rectangle containing a walk given in repeated direction blocks. | Medium5 | SimulationPrefix sum+1 | No attempts yet | 1s | 512 MB | Judgeable |
| ButtonsSimulate single counter increments and global max-fill operations to find the final counter values. | Medium5 | SimulationArray | No attempts yet | 1s | 512 MB | Judgeable |
| MatchesFlip the fewest matches in a row so fire lit at the left end spreads through every neighboring pair. | Medium5 | Dynamic programmingPrefix sum | No attempts yet | 1s | 512 MB | Judgeable |
| BrothersChoose the largest set of families whose position spans never overlap so each kept family stands together. | Medium5 | GreedyIntervals+1 | No attempts yet | 1s | 512 MB | Judgeable |
| MerchantBuy in one city and sell in another along a line to maximize selling price minus buying price minus travel cost. | Medium5 | GreedyPrefix sum | No attempts yet | 1s | 512 MB | Judgeable |
| Car WorkshopsCars pass through workshops in order and each one repaints color a to b on a match, so compute every final color. | Medium5 | SimulationArray | No attempts yet | 1s | 512 MB | Judgeable |
| Chemical ReactionsCount unowned compounds that become producible by repeatedly firing reactions whose substrates are all available. | Medium5 | BFSGraph+1 | No attempts yet | 1s | 512 MB | Judgeable |
| DistanceChoose two array elements, possibly the same element twice, to maximize the sum of the two values plus the distance between their positions. | Medium5 | GreedyArray | No attempts yet | 1s | 128 MB | Judgeable |
| CitiesCount for each city on a directed line how many other cities are reachable through one-way and two-way roads. | Medium5 | ArrayPrefix sum | No attempts yet | 1s | 128 MB | Judgeable |
| Balls in a Binary TreeFollow the n-th ball down h levels of toggling switches, going left on odd visits and right on even visits, to find its leaf number. | Medium5 | Bit manipulationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ChildrenGiven a permutation on n cells, find the fewest adjacent swaps so every walk visits all cells. | Medium5 | GraphArray | No attempts yet | 1s | 128 MB | Judgeable |
| Raffle TicketsBuy tickets from baskets with known winning and losing counts to guarantee at least g wins with the fewest tickets. | Medium5 | Dynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Traffic LanesFind the fewest lane changes needed to drive across an n by m grid of blocked and free cells, starting and ending in any lane. | Medium5 | Shortest pathBFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Paper StripFind the longest contiguous block of numbers that adds up to exactly s, or print BRAK when none exists. | Medium5 | Hash mapPrefix sum | No attempts yet | 1s | 128 MB | Judgeable |
| RadiotelegraphGiven n integers and at most w changes to any values, find the longest run of equal numbers achievable. | Medium5 | Sliding windowHash map | No attempts yet | 1s | 128 MB | Judgeable |
| Planting PotatoesDistribute up to m potatoes over fields capped at b_i so the sum of squared counts is as large as possible. | Medium5 | GreedySorting | No attempts yet | 1s | 128 MB | Judgeable |
| Equalizing Water in GlassesGiven the water levels in n adjacent glasses, find the fewest pours between neighbors that make all levels equal. | Medium5 | GreedyPrefix sum | No attempts yet | 1s | 128 MB | Judgeable |
| Chinese RestaurantsPick the intersection that minimizes the farthest distance to a marked restaurant and report that distance, or -1 when no restaurant exists. | Medium5 | TreeBFS | No attempts yet | 1s | 128 MB | Judgeable |
| The BoardFind the longest string of zeros followed by ones that appears as a subsequence of both given binary sequences. | Medium5 | GreedyTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TowerEach resident climbs the steps from the bottom and stops before the first step whose height reaches their own. | Medium5 | Binary searchPrefix sum | No attempts yet | 1s | 128 MB | Judgeable |
| Paper RollsSet every roll to one shared unrolled length within each total length using the fewest 1-cm moves. | Medium5 | SortingMath | No attempts yet | 1s | 128 MB | Judgeable |
| ForestFind the smallest possible oldest-tree age among all edge-connected groups of exactly d trees in an n by n age grid. | Medium5 | Binary searchBFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Binary SumGiven k, print in binary the sum of all integers from 1 to the largest k-digit binary number. | Medium5 | MathBit manipulation | No attempts yet | 1s | 128 MB | Judgeable |
| BubuFind Bubu's fastest route to clearing 1 that reaches every clearing before any ranger does, or report -1. | Medium5 | Shortest pathGraph | No attempts yet | 1s | 128 MB | Judgeable |
| The CrossingPair at most two riders per shared boat within the weight limit or send each alone, and find the lowest total fare. | Medium5 | GreedySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| WatchtowersFind the maximum sum over any nonempty block of consecutive towers arranged in a circle. | Medium5 | Dynamic programmingArray | No attempts yet | 1s | 128 MB | Judgeable |
| Neighborhood RivalryEach cell of the grid needs the maximum value inside the square of radius R centered on it. | Medium5 | Sliding windowMatrix+1 | No attempts yet | 2.5s | 128 MB | Judgeable |