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,730 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Word MathAssign distinct digits 0-9 to letters so that the sum of several words, read as base-10 numbers, is as large as possible. | Medium4 | GreedyMath+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Lecture RoomsGiven N lecture intervals, compute the minimum number of rooms needed so no room hosts overlapping lectures, treating touching endpoints as non-overlapping. | Medium4 | GreedySorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Highway ShortcutsCompute the minimum driving distance from position 0 to D on a highway with up to 12 one-way shortcuts that skip forward sections. | Medium4 | Shortest pathGraph+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Triangle BuilderGiven N straw lengths, pick three that form a triangle with the largest possible perimeter, or report -1 if none exist. | Medium4 | SortingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Selling GoodsGiven each buyer's max price and delivery cost, choose a sale price (ties broken by lowest) that maximizes total profit summed over buyers who purchase profitably. | Medium4 | Brute forceSorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| English ReadingCount how many dictionary-word combinations match each scrambled sentence when each word's middle letters can be permuted freely. | Medium4 | Hash mapString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Bubble Sort Swap CountCount the number of adjacent swaps bubble sort performs to sort an array, equivalent to counting inversions efficiently. | Medium4 | SortingDivide and conquer+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Lee Dongho's TruckGiven pillar coordinates in a square warehouse, find the widest integer-width straight lane from west to east that touches no pillar or wall. | Medium4 | SortingGeometry+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Minsik Language Word SortingSort Minsik language words using a custom 20-letter alphabet where the digraph 'ng' counts as a single letter between 'n' and 'o'. | Medium4 | StringSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Overlapping SegmentsGiven N line segments on a number line, compute the maximum number of segments that overlap at any single point, not counting endpoint-only contacts. | Medium4 | IntervalsSorting+2 | No attempts yet | 2s | 256 MB | Judgeable |
| New EmployeesGiven N applicants ranked by two criteria, count applicants not dominated in both ranks by any other applicant (classic sort plus max-suffix pattern). | Medium4 | SortingGreedy | No attempts yet | 2s | 256 MB | Judgeable |
| Router InstallationGiven house coordinates, place C routers among them to maximize the minimum pairwise distance between chosen routers. | Medium4 | Binary searchGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Post OfficeGiven villages with positions and populations on a line, find the point minimizing total weighted distance, choosing the smallest position on ties. | Medium4 | SortingPrefix sum+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Cipher DecryptionGiven a key and ciphertext produced by a columnar transposition cipher, reconstruct the original plaintext. | Medium4 | StringSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Kimchi DeliveryGiven N cities on a line and a starting point, find the order of visiting all cities minimizing the sum of arrival times. | Medium4 | GreedyDynamic programming+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Custom Table SorterRead tables and per-line sort specifications, then output the table rows stably sorted by given field/direction keys for each specification, grouped and formatted with blank lines. | Medium4 | SortingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SensorsGiven N sensor coordinates and up to K interval-shaped concentrators, find the minimum total interval length needed to cover all sensors. | Medium4 | SortingGreedy | No attempts yet | 2s | 128 MB | Judgeable |
| Proving PropositionsGiven directed edges between letters, compute the transitive closure and print all reachable pairs excluding self-loops, sorted by letter order. | Medium4 | GraphDFS+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Choose Two Numbers With Minimum DifferenceGiven N integers and threshold M, find the minimum absolute difference between two elements that is still at least M. | Medium4 | SortingTwo pointers+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Choosing CondosCount condos that are Pareto-optimal, having no other condo that is both closer to the beach and cheaper. | Medium4 | SortingGreedy | No attempts yet | 2s | 128 MB | Judgeable |
| Symmetric DrawingGiven N marked points, decide if there is a vertical line x=c so that folding the plane along it maps the point set onto itself, and output that x-coordinate or NO. | Medium4 | MathHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Post OfficeGiven village coordinates and resident counts, find the smallest position minimizing total weighted distance to all residents (weighted median). | Medium4 | SortingPrefix sum+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Keyword MatchingGiven weighted keyword lists for pages and queries, compute matching scores and output up to 5 top-scoring pages per query. | Medium4 | SortingHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Sum of DistancesGiven n points on a line, compute the sum of absolute distances over all ordered pairs efficiently using sorting and prefix sums. | Medium4 | SortingPrefix sum+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Three Numbers, Two MsGiven n integers, pick three to maximize 3 times (median minus mean), which reduces to sorting and checking min/max extremes. | Medium4 | SortingGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| File Similarity ChecksGiven N file sizes, count pairs where the smaller size is at least 0.9 times the larger size. | Medium4 | SortingTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Smallest Unmeasurable WeightGiven N integer weights usable only on one pan, find the smallest positive integer amount that cannot be formed as a subset sum. | Medium4 | GreedySorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Two LiquidsGiven N distinct integers, sort them and use two pointers to find the pair whose sum is closest to zero. | Medium4 | Two pointersSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Amusement ParkGiven ride schedules with 10-minute buffers before and after each, find the longest free interval within 10:00-22:00 where no ride's blocked window overlaps. | Medium4 | IntervalsSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Music ProgramMerge several partial orderings of singers into one total order using topological sort, or report impossibility if a cycle exists. | Medium4 | Topological sortGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Stacking Colored PaperGiven N rectangles with allowed 90-degree rotation, find the longest chain where each sheet fits entirely inside the previous one. | Medium4 | Dynamic programmingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Clock Card RankGiven four clockwise digits on a card, compute the minimal rotation (clock number) and find its rank among all distinct clock numbers from digits 1-9. | Medium4 | Brute forceSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ChainsGiven lengths of N chains, find the minimum number of links to open and close so that all chains merge into a single chain. | Medium4 | GreedySorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| ALPS-Style VotingSimulate a D'Hondt-style seat allocation: filter staff by a 5% vote threshold, generate divided scores, pick the top 14, and count chips per staff sorted by name. | Medium4 | SimulationSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Basketball Lead TimeGiven timestamped scoring events over a 48 minute game, compute the total time each team held the lead. | Medium4 | SimulationSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Frequency SortSort a sequence of up to 1000 integers by descending frequency, breaking ties by the value's first appearance order in the input. | Medium4 | Hash mapSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Choosing a NameGiven even integers and a range [A,B], find an odd integer in that range maximizing the minimum distance to all given even values. | Medium4 | ArrayGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Battle Order ScoreCount pairs of items whose relative order matches between a reference sequence and a given permutation, and print as a fraction over N(N-1)/2. | Medium4 | ArrayBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Teams with Sum ZeroCount the number of index triples among N students whose skill values sum to exactly zero. | Medium4 | ArrayTwo pointers+1 | No attempts yet | 4s | 128 MB | Judgeable |
| Race RankingSimulate M checkpoint messages in order, keep only valid sequential checkpoint passes per driver, and print final ranking by progress and recency. | Medium4 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Robot ProjectGiven a target length and up to a million rod lengths, find two rods summing exactly to the target with the maximum length difference, or report impossibility. | Medium4 | Two pointersSorting+1 | No attempts yet | 5s | 256 MB | Judgeable |
| Double QueueProcess a stream of add/serve commands maintaining a dynamic set to pop and remove either the maximum or minimum priority client each query. | Medium4 | HeapSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| KCPCFrom a submission log, compute each team's best-per-problem total score, break ties by submission count then last submission time, and output a given team's rank. | Medium4 | SimulationHash map+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Republic of KoreaCount crossing pairs among K straight highways linking numbered east and west coast cities, using inversion counting. | Medium4 | SortingDivide and conquer+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SongsGiven songs with lengths and play frequencies, sort them by length-to-frequency ratio (stable on ties) to minimize expected access time and report the song at a queried position. | Medium4 | GreedySorting | No attempts yet | 1s | 128 MB | Judgeable |
| BookletsGiven booklets sorted by page count split among schools using floor/ceiling division with a strict serving order, find the first booklet's page count given to a specified school. | Medium4 | SortingMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Happy Phone CallFor each query time window, count how many given phone-call intervals overlap it by at least one second, across multiple test cases. | Medium4 | IntervalsSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Slim SpanGiven a weighted graph, find the spanning tree that minimizes the difference between its largest and smallest edge weight, or report -1 if disconnected. | Medium4 | Union-findSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Pizza HawaiiFor each local ingredient and native ingredient, output the pair when the two words appear on exactly the same set of pizza names. | Medium4 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Touchscreen KeyboardGiven a typed word and a list of same-length dictionary words, print each with its keyboard Manhattan distance, sorted by distance then lexicographically. | Medium4 | StringSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Babs’ Box BoutiqueGiven up to 10 boxes, each orientable in 3 ways, find the largest subset that can be stacked with each base fitting inside the one below. | Medium4 | Dynamic programmingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Flash MobGiven n grid points, find the intersection minimizing the total Manhattan distance, breaking ties by smallest x then smallest y. | Medium4 | SortingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Shoring Up the LeveesGiven a convex quadrilateral, order its four corner triangles by area and print each triangle's area and perimeter rounded to three decimals. | Medium4 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Room PaintingGiven n can sizes and m paint requirements, sum the waste from picking for each colour the smallest can whose size is at least the requirement. | Medium4 | SortingBinary search | No attempts yet | 1s | 128 MB | Judgeable |
| Course SchedulingGiven n course requests as (first name, last name, course) triples, count the distinct students per course and print courses in ASCII order. | Medium4 | Hash mapSorting | No attempts yet | 1s | 128 MB | Judgeable |
| CDGiven two sorted lists of distinct CD numbers, count how many numbers appear in both lists. | Medium4 | Two pointersSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| AlaskaGiven charging station positions along a 1422-mile highway and a 200-mile range, decide whether the round trip Dawson Creek to Delta Junction and back is possible. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Convex HullGiven points already labeled as hull or non-hull, output only the hull points in counterclockwise order starting from the lexicographically smallest one. | Medium4 | GeometrySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Dragon of LoowaterMatch the smallest knight to each dragon head so that every head is cut by a tall enough knight, minimizing total height paid; report failure if impossible. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The TripGiven what each student spent, find the minimum total money that must change hands so every student ends up paying the same amount within one cent. | Medium4 | GreedyMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CDVIIPair each vehicle's enter records with the immediately following exit, charge per-kilometre tolls by start hour plus fees, and print sorted totals in dollars. | Medium4 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Contest ScoreboardGiven judging queue entries, compute each contestant's solved count and penalty time, then print the standings in rank order. | Medium4 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Poker HandsCompare two five-card poker hands and decide which ranks higher, handling all standard categories and tie-breaks. | Medium4 | ImplementationSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Is Bigger Smarter?Given pairs of weight and IQ for up to 1000 elephants, find the largest subset whose weights strictly increase while IQs strictly decrease. | Medium4 | Dynamic programmingSorting | No attempts yet | 1s | 128 MB | Judgeable |
| The History of the Sith RulersGiven up to 50 rulers with the start and end months of each reign, report which rulers held power during each queried year, in order. | Medium4 | SortingImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Relative RelativesGiven Ted's age of 100 and each descendant's father name plus the father's age at the child's birth, compute every descendant's age and list them oldest first, ties broken by name. | Medium4 | TreeDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Electronic Document SecurityProcess a log of ACL +, -, = entries in order and print the final rights for each entity, merging entities with identical rights. | Medium4 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Frugal SearchGiven a word list and queries of bar-separated terms with unsigned, plus, and minus letters, output the lexicographically smallest matching word or NONE for each query. | Medium4 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Programmer, Rank ThyselfRank teams by problems solved, total time, and rounded geometric mean, then print aligned result tables. | Medium4 | SortingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Finding RectanglesList every axis-aligned rectangle that can be formed from up to 26 labeled points, printing the four vertex labels in clockwise order. | Medium4 | Brute forceGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Perfect CubesFind all quadruples a, b, c, d with 2 <= a <= N, b < c < d, and a^3 = b^3 + c^3 + d^3, printed in sorted order. | Medium4 | Brute forceMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Letter Sequence AnalysisRead a text block to EOF and, for each sequence length 1 to 5, list the five most frequent letter sequences with alphabetized ties. | Medium4 | StringHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Underground CablesGiven up to 1000 points, connect them all with straight line segments of minimum total length, with no two segments crossing. | Medium4 | Minimum spanning treeGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Shrew-ologyGiven per-trait dominance rules and adult shrews with sex and trait bits, list every mother-father pair that could produce each juvenile. | Medium4 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| NineFor each desired microwave time, pick the four-digit MM:SS entry with the most 9s, then the least error under 10%, then lexicographically smallest. | Medium4 | Brute forceImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| A Day at the RacesRead a season of Grand Prix results and print final standings for drivers and teams, breaking ties by countback and then lexicographically. | Medium4 | SimulationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Phone ListGiven a list of distinct phone numbers, decide whether any number is a prefix of another. | Medium4 | TrieString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Who Is the Winner?Given a log of contest submissions with verdicts and times, compute each contestant's solved count and ICPC-style penalty score, then output them ranked. | Medium4 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pythagorean TriplesGiven up to 50 distinct positive integers, list all Pythagorean triples x<y<z present in the set, sorted lexicographically, or report that none exist. | Medium4 | Hash mapMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Shut the Box IGiven a target sum and a sorted list of open card values, choose the subset summing to the target that is lexicographically largest when sorted. | Medium4 | BacktrackingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Open IntervalsGiven up to 50 open intervals per test case, pick the largest subset where no two intervals overlap, counting touching endpoints as compatible. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Stacking BooksGiven a stack of book sizes, find the fewest moves that pull one book to the top (only when the part above it is non-decreasing) to sort the stack. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Best PizzaChoose any subset of toppings, each costing B, to maximize total calories divided by total price, and print the floor of that ratio. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PizzaGiven store positions on a circular road and delivery points, sum the distance from each point to its nearest store. | Medium4 | Binary searchArray+1 | No attempts yet | 2s | 128 MB | Judgeable |
| The Longest StaircaseGiven k cards with distinct values 1 to n plus one blank card (0) you can set to any value, find the longest run of consecutive integers formable. | Medium4 | SortingTwo pointers+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Product Order TotalsSum the order quantities for each distinct product name, then print each product with its total sorted by name length, then alphabetically. | Medium4 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| King's PokerGiven a three-card poker hand, print the weakest set or pair that beats it, or * if none exists. | Medium4 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Average and MedianFor each pair A and B, find the smallest integer C so that the average and the median of A, B, C are equal. | Medium4 | MathSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Soccer LeagueRead a list of soccer match results and output the league table sorted by points, then goal difference, then first appearance in the input. | Medium4 | Hash mapSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow CrossingsCount cows whose straight crossing paths intersect no other cow, where two paths cross exactly when the start and end left-to-right orders differ. | Medium4 | SortingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GiftGiven each friend's item price and shipping cost and one coupon that halves a single item price, find the most gifts buyable within budget B. | Medium4 | SortingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Haybale StackingAdd one bale to every stack in each given range, then report the median height among all N stacks. | Medium4 | Prefix sumArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Moo SickFind every window of C consecutive notes whose sorted, min-subtracted shape matches the given chord's shape. | Medium4 | ArraySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Music NotesGiven note durations that divide a timeline into consecutive intervals, answer queries asking which 1-based note covers a given time. Use prefix sums and binary search. | Medium4 | Prefix sumBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Selfish GrazingGiven N intervals, find the maximum number of intervals that can be chosen so that no two of them overlap. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Find the Playing NoteGiven note durations that partition a timeline, answer queries asking which note covers a given beat by locating the prefix sum that brackets it. | Medium4 | Prefix sumBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chocolate BuyingGiven N chocolate types with a cost per piece and a number of cows wanting each, spend a budget B to satisfy as many cows as possible. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Time ManagementGiven each chore's duration and deadline, find the latest start time that lets John finish all chores before their deadlines, or print -1. | Medium4 | GreedySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ScrabbleGiven a tray of T letters (some blanks that score 0) and an alphabetized dictionary, pick the highest-scoring dictionary word formable from the tray, breaking ties alphabetically. | Medium4 | StringGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| O Those FadsCows join a fad when its attractiveness L reaches their resistance; each joiner raises L by K. Count the final number of participants. | Medium4 | SortingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |