Curated sets

Interview core

The mediums that show up in real onsite loops.

All problems
Total results1,547 problems
TopicsJudge
Perfect ChoirGiven sorted starting notes for N singers, each measure moves one singer up and another down by one; find the minimum measures until all notes are equal, or -1 if impossible.Medium7MathGreedy+2No attempts yet2s512 MBJudgeable
Road ConstructionGiven a weighted bidirectional graph, find the minimum total building cost of a spanning subgraph that keeps every pairwise connection and preserves the shortest distance from the capital to every city.Medium7GraphShortest path+2No attempts yet8s512 MBJudgeable
Expect to WaitGiven a time-ordered schedule of unicycle drops and grouped requests, compute the total wait time of all requesters for each of several starting unicycle counts, or report infinity if anyone is left waiting.Medium7Prefix sumBinary search+2No attempts yet2s512 MBJudgeable
Longest Increasing Subsequence 4Find a longest strictly increasing subsequence of A, and among all of maximum length output the lexicographically smallest one along with its length.Medium7Dynamic programmingBinary search+2No attempts yet1s256 MBJudgeable
ProbabilityGiven probabilities of letters A to D, find the probability that an optimally played game fills a row of n cells in alphabetical order.Medium7Dynamic programmingProbability+2No attempts yet1.5s512 MBJudgeable
FormulaFind the maximum number of edges in a closed trail that uses every important edge at least once, or report that none exists.Medium7GraphBit manipulation+1No attempts yet1s128 MBJudgeable
MajstorChoose a prerequisite-closed set of jobs that maximizes total fee divided by total hours, with the quotient floored.Medium7GreedySorting+2No attempts yet3s128 MBJudgeable
Arranging HeapsDivide N ordered mining points into K groups, each group merging into one heap at its last point, minimizing total weighted distance moved.Medium7Dynamic programmingDivide and conquer+2No attempts yet2s512 MBJudgeable
Christmas EveGiven n weighted warehouses on a line, choose k of them as teleporter sites so that moving every other warehouse's presents into a chosen site gives the least total weighted distance.Medium7Dynamic programmingSorting+2No attempts yet2s512 MBJudgeable
Placing the CardsGiven the top view of overlapping rectangular cards, find the placement order that produces it, choosing the lexicographically smallest valid order.Medium7GraphTopological sort+2No attempts yet2s512 MBJudgeable
Red Tape Committee (Large)Choose exactly K of N members, each with a known Yes probability, to maximize the chance that exactly half vote Yes.Medium7Dynamic programmingProbability+2No attempts yet5s512 MBJudgeable
Close Match (Large)Fill question marks in two equal-length digit strings to make the scores as close as possible, breaking ties by the smallest C then smallest J.Medium7Dynamic programmingGreedy+2No attempts yet5s512 MBJudgeable
Placing TilesGiven a grid with blocked cells, cover every empty cell with 1 x k horizontal or vertical tiles (k is any positive integer, chosen per tile) and minimize the number of tiles.Medium7BacktrackingDynamic programming+2No attempts yet2s512 MBJudgeable
Longest Palindromic SubstringGiven a lowercase string of up to 100,000 characters, report the length of its longest palindromic substring.Medium7StringString matching+2No attempts yet2s512 MBJudgeable
Counting Palindromes (Small)Count how many subsequences of a string of length up to 30 are palindromes, treating subsequences that use different positions as distinct.Medium7Dynamic programmingString+2No attempts yet2s512 MBJudgeable
IliGiven a DAG of two-input OR gates where some gate outputs are measured, determine which remaining gate outputs are forced to a single value across all valid assignments of the wires.Medium7GraphDFS+2No attempts yet4s1024 MBJudgeable
Mahjong Waiting TilesGiven a 13 tile mahjong hand numbered 1 to 9, list every tile still available that completes the hand into one head plus four bodies, or into seven distinct heads.Medium7BacktrackingRecursion+2No attempts yet1s256 MBJudgeable
Subin and the Melting CandyStarting at the origin and moving only right or up, visit baskets over time to maximize total candies collected, where a basket's candies shrink by one per time unit.Medium7Dynamic programmingSortingNo attempts yet1s64 MBJudgeable
Professional NetworkGiven N people, each joinable when Kevin's current connection count reaches A_i or by paying B_i points, find the minimum total points to connect with everyone.Medium7GreedySorting+2No attempts yet2s512 MBJudgeable
The cube loverGiven up to 10^18 unit cubes, find positive integer box dimensions x, y, z with x*y*z >= K that minimize the surface area 2(xy+yz+zx), breaking ties by lexicographically smallest triple.Medium7MathNumber theory+2No attempts yet0.5s512 MBJudgeable
Venue Rental (Large)Given up to 3000 axis-aligned rectangles, find the total area of their union, counting overlaps once.Medium7GeometrySorting+2No attempts yet5s256 MBJudgeable
Bathroom StallsSimulate K people choosing the emptiest interval by a tie-break rule, and report the gap sizes of the K-th chosen stall.Medium7HeapGreedy+2No attempts yet5s512 MBJudgeable
Bathroom Stalls (Large)Simulate K people choosing bathroom stalls by the maximize-min-then-max-then-leftmost rule, and report the max and min distances for the last chooser when N can be 10^18.Medium7HeapGreedy+2No attempts yet5s512 MBJudgeable
Binary String ToggleApply U range-toggle operations to an all-zero binary string and print the lexicographically largest string among all U+1 intermediate states.Medium7Prefix sumGreedy+1No attempts yet2s512 MBJudgeable
Moving 2Given an N by N grid of candy amounts, collect the most candy over K monotone paths from (1,1) to (N,N), counting each cell only once.Medium7Dynamic programmingImplementation+1No attempts yet2s512 MBJudgeable
ConquerorConquer all cities from city 1, where the k-th city you take costs the edge cost plus (k-1)*t, and minimize the total.Medium7Minimum spanning treeGreedy+2No attempts yet2s256 MBJudgeable
How Many to Be Happy?For each edge find the fewest edges to delete so that it lies in some minimum spanning tree, then sum those counts.Medium7Minimum spanning treeGraph+2No attempts yet0.5s512 MBJudgeable
Envious ExponentsGiven N and k, find the smallest integer greater than N whose binary representation has exactly k ones.Medium7Bit manipulationGreedy+2No attempts yet2s512 MBJudgeable
Biotechnology laboratoryGiven a string of lowercase letters weighted 1 to 26, count how many distinct total weights occur among all non-empty substrings.Medium7Prefix sumTwo pointers+2No attempts yet7s1024 MBJudgeable
Keeping On TrackGiven a tree with n+1 nodes, find the node whose removal splits it worst, then pick the best non-edge to add so the remaining disconnected pairs are minimized.Medium7TreeDFS+2No attempts yet2s512 MBJudgeable
Deck of CardsTwo players alternate playing a card matching the table card in color or value; the first unable to move loses, so find the winner under optimal play.Medium7Game theoryGraph+2No attempts yet5s512 MBJudgeable
InitialsEach student's directory starts as last-initial plus first-initial; append letters from the full names so names strictly increase in class order, minimizing total letters added.Medium7Dynamic programmingString+2No attempts yet3s512 MBJudgeable
ArtistChoose exactly K blocks from N to minimize (sum of chosen widths) times (sum of chosen heights), where each block keeps its orientation.Medium7Dynamic programmingSorting+2No attempts yet1s512 MBJudgeable
BricksCount the distinct sets of occupied boxes reachable after M bricks fall, where a brick at an occupied position expands its run left or right.Medium7Dynamic programmingIntervalsNo attempts yet0.2s512 MBJudgeable
Bumped!Given an undirected weighted road graph and up to 1000 directed free flights, find the cheapest s-to-t trip using at most one flight.Medium7GraphShortest path+2No attempts yet2s512 MBJudgeable
RhombinoesGiven live equilateral triangles on a W by H board, find the maximum number of non-overlapping rhombinoes, each covering two live triangles that share a side.Medium7GraphDynamic programming+2No attempts yet2s512 MBJudgeable
MizuyokanGiven a bar divided by N-1 score lines into segments of given lengths, cut along some lines so the longest and shortest resulting pieces differ as little as possible.Medium7Dynamic programmingBinary search+2No attempts yet2s512 MBJudgeable
Minimum Edit 2Compute the minimum number of insertions, deletions, replacements, and adjacent swaps needed to turn string A into string B, with both strings up to length 1000.Medium7Dynamic programmingString+2No attempts yet2s512 MBJudgeable
We Don't Wanna Work!Maintain a dynamic set of members whose top floor(20%) by motivation and join time are workhorses, and log every time a member's status flips after each join or departure.Medium7TreeSorting+2No attempts yet2s512 MBJudgeable
Marble Escape 4On a small board with one red marble, one blue marble, and a single hole, tilt until the red marble falls through the hole while the blue never does; report the fewest tilts or -1.Medium7BFSSimulation+2No attempts yet2s512 MBJudgeable
Road ConstructionGiven a permutation, for each query [l,r] reverse that segment and report the number of maximal increasing runs in the resulting array.Medium7ArrayMath+2No attempts yet1s128 MBJudgeable
Yonsei Water ParkGiven N stones in a line with values K_i, pick a starting stone and a sequence of distinct stones where each jump moves at most D positions, maximizing the sum of visited values.Medium7Dynamic programmingSegment tree+1No attempts yet1s128 MBJudgeable
Solving cubic equations 2Find all real roots of a cubic with rational coefficients, printing them rounded to four decimals, using that at least one root is an integer.Medium7MathBinary search+2No attempts yet2s512 MBJudgeable
Chicken DeliveryChoose at most M of the chicken restaurants to keep open so that the sum over all houses of the distance to the nearest open restaurant is minimized.Medium7Brute forceBacktracking+2No attempts yet1s512 MBJudgeable
Marathon CourseChoose a simple path from 1 to N minimizing the cost of its roads, where each road costs C*(P-T)^2 when P > T, and find the largest P whose cost fits budget K.Medium7Shortest pathGraph+2No attempts yet2s512 MBJudgeable
Block GameRemove every block so the heights leave in non-decreasing order, minimizing moves of a machine that walks left and right along the shrinking row.Medium7Dynamic programmingGreedy+2No attempts yet2s512 MBJudgeable
Please Take My Gift 2Given a 1 by N arrow map where every walk stays inside, place the fewest gifts so that a walk from any starting cell hits a gift.Medium7GraphGreedy+2No attempts yet2s256 MBJudgeable