Curated sets
Interview hard
Hard rounds and final-stage questions.
Total results39 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Paper RouteWith N+1 nodes and exactly N roads, find the cheapest closed walk from node 0 covering all addresses, then add the campus travel cost from wherever you end. | Hard8 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Brief GerrymanderChoose A avenue boundaries including 1 and 100 to maximize the number of vertical strips that contain at least one marked neighborhood, given fixed street boundaries. | Hard8 | Dynamic programmingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Spare the Ewoks!Given an m by n grid with blocked cells, choose up to three non-overlapping axis-aligned rectangles to maximize the total covered area. | Hard8 | Dynamic programmingPrefix sum+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Repair DepotsPlace at most c depots anywhere in the plane to minimize the largest distance from any of n bots (n at most 16) to its nearest depot, and print that distance to six decimals. | Hard8 | Binary searchGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Quick SearchGiven a small graph and k officers all starting at A, find the minimum time for the officers to jointly visit every node, where each officer walks a path. | Hard8 | GraphDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The DoorsGiven up to 18 vertical walls, each with two doorways, find the shortest path from (0,5) to (10,5) inside a 10x10 square without crossing any solid segment. | Hard8 | GeometryGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Game of StonesGiven a directed acyclic graph with stones on nodes, two players alternately slide one stone along an edge; decide whether the first player wins. | Hard8 | Game theoryGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Escaping the Tutoring HouseFind whether a tutor can reach the exit while keeping all kids inside a forward half-plane at every instant, and if so, the shortest such path. | Hard8 | GeometryGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ClockFind the largest empty circle fully inside a rectangular wall that avoids up to 50 non-overlapping discs, using a generalized Voronoi diagram of points, segments, and circles. | Hard8 | GeometryDivide and conquer+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Pharaoh's CurseOn a small grid, S pushes up to two sarcophagi onto buttons while stepping around them, and must reach the exit with all buttons held; find the minimum steps or report impossible. | Hard8 | BFSGraph+2 | No attempts yet | 5s | 128 MB | Judgeable |
| Fat NinjasGiven point sensors in an N by N square, find the diameter of the largest circle that can travel from the left side to the right side without touching any sensor. | Hard8 | GeometryUnion-find+2 | No attempts yet | 3s | 128 MB | Judgeable |
| StarCowraftGiven test battle outcomes and the constraint that no unit strength exceeds 100 times another, determine for each new battle whether one army must win or the result is undecidable. | Hard8 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Doing WindowsGiven a screen and four windows with fixed aspect ratios, decide whether the windows can be resized and placed to tile the screen with no gaps or overlaps. | Hard8 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CensorshipGiven a text and a filter word set, remove occurrences repeatedly to make the shortest possible result and report its length. | Hard8 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| One-Way RoadsDecide whether the undirected streets of a graph can all be oriented so that each required ordered pair stays reachable from the first to the second. | Hard8 | GraphDFS+2 | No attempts yet | 2s | 64 MB | Judgeable |
| Prison rearrangementGiven a bipartite conflict graph between two prisons of size m, find the largest k <= m/2 so that k prisoners can be swapped across while keeping every conflicting pair apart. | Hard8 | GraphBFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IslandGiven all pairwise shortest tolls among the n seaside triangles, recover the adjacency structure and edge weights of the underlying border tree. | Hard8 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SchoolsAssign a distinct number 1..n to each school within its allowed interval, minimizing the total weighted movement cost. | Hard8 | GreedyDynamic programming+2 | No attempts yet | 3s | 128 MB | Judgeable |
| PlotPartition a sequence of n points into at most m contiguous groups, replacing each group with one point, to minimize the maximum distance from any original point to its group's representative. | Hard8 | Binary searchDynamic programming+2 | No attempts yet | 30s | 128 MB | Judgeable |
| Finding an integerFind the smallest integer at least N whose decimal digits contain d1 at least c1 times and d2 at least c2 times. | Hard8 | GreedyImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Laser TowersOn a grid with directional laser towers and enemy counts, choose which towers fire and at which cell so lasers never intersect, maximizing enemies destroyed. | Hard8 | GreedyBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Substitution Cipher KeyGiven N distinct words and a target permutation, find the lexicographically smallest substitution cipher key that sorts the encrypted words into that order, or report none. | Hard8 | GreedySorting+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Feasible roundingRound each decimal entry to floor or ceiling so that every row and column sum still matches its stated total, choosing the lexicographically smallest whole table. | Hard8 | GreedyMatrix+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Tire PatchesOn a circular tire, cover all hole positions with the minimum total length of uncut patches of two given lengths and return that total length. | Hard8 | Dynamic programmingArray+2 | No attempts yet | 2s | 512 MB | Judgeable |
| War Among the StarsCompute the shortest distance between two tetrahedra in space, given the coordinates of their eight vertices. | Hard8 | GeometryImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Palindrome cipher decryptionFor each string, find its longest palindromic subsequence and output the lexicographically smallest one among those of maximal length. | Hard8 | Dynamic programmingString+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Splitting Game LevelsPartition n levels into k consecutive groups to minimize the expected total time of a random coin-draw process, and print it to six decimals. | Hard8 | Dynamic programmingDivide and conquer+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Wolves 2Count binary strings of length N in which every given interval contains at most two ones, modulo 1e9+7. | Hard8 | Dynamic programmingPrefix sum+2 | No attempts yet | 2s | 512 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 |
| Company Culture 4On a rooted tree, praise spreads downward from an employee to all descendants or upward to all ancestors, the direction flips over time, and queries ask for an employee's accumulated praise. | Hard8 | TreePrefix sum+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Imbalance ObviationAssign each marble L or R so the pan difference stays within 1 during insertion in order and during a given removal permutation; output the lexicographically smallest assignment. | Hard8 | GreedyImplementation+2 | No attempts yet | 20s | 1024 MB | Judgeable |
| Monday BluesGiven an N by M grid with costly buildable cells and blocked or unbuildable cells, find the minimum total cost to cut every path from (1,1) to (N,M), or report that no placement can do it. | Hard8 | GraphMinimum spanning tree+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Alien microbesCount the breeding patterns over H days starting from one microbe, where each day the microbes alive produce children with a total of at most W. | Hard8 | Dynamic programmingCombinatorics+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Shooting GalleryA row of ducks, each with a species; a good round hits two ducks of the same species and keeps only the ducks strictly between them, and rounds continue while same-species pairs remain. Find the longest possible run of good rounds. | Hard8 | Dynamic programmingArray+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SumdokuFill a 9x9 Sudoku grid so that constrained adjacent cells inside each 3x3 block satisfy <, =, or > versus 10, and print the lexicographically smallest solution. | Hard8 | BacktrackingImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Ladder ManipulationGiven a ladder with N vertical lines, H rows, and M existing rungs, find the minimum number of rungs to add so every walk from column i ends at column i, or report -1 if more than 3. | Hard8 | BacktrackingBrute force+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 |
| 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 |
| 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 |