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 results3,692 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Burger, French Fries, Soft DrinkCount the ways to cut a B/F/S stream into N consecutive blocks where every block has equal positive counts of each letter, or report Impossible. | Medium6 | Dynamic programmingPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Taxi!Given a bidirectional weighted graph where each road has a traversal time and a fare, find the minimum total time from s to d whose total fare stays within budget r. | Medium6 | GraphShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Transitive ClosureCount off-diagonal pairs (X, Y) with a directed path from X to Y in a graph of up to 2500 vertices and 10000 edges. | Medium6 | GraphDFS+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Add Them UpGiven counts of each digit 1-9, sum every distinct number formable using each digit at most as often as it appears, modulo 1e9+7. | Medium6 | CombinatoricsDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Euro EfficiencyGiven six coin denominations, find the minimum coins (paid plus change) for each amount from 1 to 100 and report their average and maximum. | Medium6 | Dynamic programmingShortest path+2 | No attempts yet | 1s | 128 MB | Judgeable |
| TriangulationGiven a convex polygon, find the triangulation whose total diagonal length is minimum and report it rounded to two decimals. | Medium6 | Dynamic programmingGeometry | No attempts yet | 1s | 128 MB | Judgeable |
| SkewersCount strings of length n over p letters that avoid a given set of forbidden bigrams and trigrams, modulo m. | Medium6 | Dynamic programmingMatrix | No attempts yet | 1s | 128 MB | Judgeable |
| CaveGiven a transitive reachability matrix of a DAG, find the minimum number of downward paths needed to cover every node. | Medium6 | GraphGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chris MartinGiven a DNA string S of length n, find the smallest possible LCS length between S and any other length-n DNA string. | Medium6 | Dynamic programmingString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CastleFind a walk from chamber e to chamber p, possibly revisiting chambers with repeated charges, whose total entry cost is exactly b, and print the lexicographically smallest such walk. | Medium6 | GraphDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SpeleologyGiven a DAG where chambers are numbered top to bottom, find the maximum number of downward paths from chamber 1 to chamber n that use distinct first corridors and distinct last corridors. | Medium6 | GraphDynamic programming+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Three-Coloring of Binary TreesGiven a binary tree as a digit specification, color each node red, green, or blue so adjacent nodes differ and siblings differ, then report the maximum and minimum number of green nodes. | Medium6 | TreeDFS+2 | No attempts yet | 3s | 128 MB | Judgeable |
| FrogmanChoose whole cylinders so their combined oxygen and nitrogen meet required volumes while total weight is minimal. | Medium6 | Dynamic programmingGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Cheap TravelsPick a sequence of hotels so consecutive stops are at most 800 km apart, minimizing total price (ties: fewest nights), and also minimizing nights (ties: lowest price). | Medium6 | Dynamic programmingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Lecture Halls ReservationChoose a set of non-overlapping intervals (open at both ends) to maximize the total length covered, given n up to 10000 and times up to 30000. | Medium6 | Dynamic programmingSorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Fibonacci WordsCount the occurrences of a given a/b pattern as a contiguous substring of the n-th Fibonacci word, overlaps included. | Medium6 | StringDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| KnightsOn a 3 by n board with one possibly blocked square per column, place the maximum number of non-attacking knights and count the number of maximum placements. | Medium6 | Dynamic programmingBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Concatenation of WordsCount the increasing selections of given words whose concatenation equals a pattern, capped at 1000000, and print the lexicographically smallest selection. | Medium6 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TeddiesCount the distinct safe arrangements of up to 152 teddies in four models so that no three consecutive share a letter or a digit, modulo 1000000. | Medium6 | Dynamic programmingCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BackpackChoose a set of items whose total mass is at most p, where each chosen item requires its named lower-indexed prerequisite to be chosen too. | Medium6 | Dynamic programmingTree+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Acyclic DecompositionGiven a directed graph, find the minimum number of acyclic subgraphs needed to partition all its edges. | Medium6 | GraphGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| DrillingGiven drilling costs at n positions along a segment, find the minimum worst-case total time to locate the reservoir boundary using adaptive queries. | Medium6 | Dynamic programmingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ChessAn n by n board with n rooks, at most one per row and column, and the placement unchanged after a 90 degree rotation is given. Count the number of such placements for n up to 50000. | Medium6 | CombinatoricsMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| BugFind the shortest route from city 1 to city n whose total length is odd, or report 0 if none exists. | Medium6 | GraphShortest path+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ConferenceGiven per-presentation ticket prices, room capacity and room rent, and group reservations, choose how many tickets to cancel to maximize revenue minus rent. | Medium6 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BracketsGiven n and k, print the k-th correct bracket sequence of length 2n in lexicographic order. | Medium6 | CombinatoricsDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| InversionsCount permutations of size n that have exactly k inversions, modulo 30011, using the Mahonian number recurrence with a sliding window over prefix sums. | Medium6 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Round-Table HandshakesCount matchings on an n-person cycle where each person shakes at most one neighbor's hand, and print the count modulo 10. | Medium6 | Dynamic programmingCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| MatchingsGiven a tree, compute the size of its maximum matching and count how many maximum matchings exist, modulo m. | Medium6 | Dynamic programmingTree+2 | No attempts yet | 3s | 128 MB | Judgeable |
| GenomesFind the length of the longest common subsequence of up to 20 permutations of size up to 500. | Medium6 | GraphTopological sort+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bit SharkFind the length of the string left after repeatedly deleting the second half of any even-length palindrome, choosing deletions to maximize bits eaten. | Medium6 | StringGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Signed Binary ExpansionGiven a decimal integer with up to 500 digits, find the smallest possible count of nonzero digits in a signed binary expansion. | Medium6 | Dynamic programmingGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bracket ExpressionsThe task is to count substrings of a bracket string that are correct bracket sequences. | Medium6 | StackDynamic programming | No attempts yet | 1s | 512 MB | Judgeable |
| Balancing the ScaleRemove the fewest bricks from the tops of the towers so the total weight on the left pan equals the total on the right. | Medium6 | Dynamic programming | No attempts yet | 1s | 512 MB | Judgeable |
| Number of Longest Increasing SubsequencesCount how many strictly increasing subsequences of the given sequence attain the maximum possible length, modulo m. | Medium6 | Dynamic programmingSegment tree | No attempts yet | 1s | 128 MB | Judgeable |
| Longest Common Increasing SubsequenceFind the length of the longest strictly increasing sequence that is a subsequence of both given sequences. | Medium6 | Dynamic programmingArray | No attempts yet | 1s | 128 MB | Judgeable |
| Paper FoldingRepeatedly fold the left part of a binary strip over the right where symbols match and find the shortest reachable length. | Medium6 | Dynamic programmingString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Paweł i GawełTwo players alternate moving a pawn across a grid, swapping floors whenever it enters a marked cell, each trying to hold the upper floor at the end. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 3s | 128 MB | Judgeable |
| DominoTopple one domino left or right and count how many fall in the longest chain reaction. | Medium6 | Dynamic programmingBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Formula RaceFinish exactly N laps with refueling pit stops and two tire types, both used at least once, in minimum total time. | Medium6 | Dynamic programmingShortest path | No attempts yet | 1s | 128 MB | Judgeable |
| Bar ArrangementCount permutations of 1 to n with exactly l left-to-right maxima and r right-to-left maxima for each test case. | Medium6 | Dynamic programmingCombinatorics | No attempts yet | 1s | 256 MB | Judgeable |
| PeriodSplit string x into pieces to minimize the largest edit distance between y and any piece. | Medium6 | Dynamic programmingString | No attempts yet | 1s | 128 MB | Judgeable |
| Practice SeasonBoth teams insert rest days into their fixed city orders to minimize combined stadium and hotel costs. | Medium6 | Dynamic programmingString matching | No attempts yet | 2s | 128 MB | Judgeable |
| CubeCut a W by L by H integer block into integer-sided cubes with the fewest cuts and output the number of cubes. | Medium6 | Dynamic programmingRecursion | No attempts yet | 10s | 128 MB | Judgeable |
| DeliveryMerge two ordered delivery lists starting from the origin to minimize total Euclidean travel distance without returning. | Medium6 | Dynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Golf CoursesPick course sites and assign every client to a built course to minimize building plus connection costs within capacities. | Medium6 | Dynamic programmingSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| GameTwo players alternately add to S within a range set by the current parity, and whoever first reaches F loses, so decide if the first player can force a win. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Contest Problem AssignmentSplit up to ten contest problems among three members with individual time limits to solve the largest possible count. | Medium6 | Dynamic programmingBit manipulation | No attempts yet | 1s | 128 MB | Judgeable |
| Prime CavesStarting from cave n on a spiral-numbered grid, descend down-left, down, or down-right to collect the most prime-numbered caves. | Medium6 | Dynamic programmingNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Powerbase FormatCount how many integers in each query range lack a powerbase form d1^1+...+dL^L within the length bound using the given digits. | Medium6 | BacktrackingDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Superstitious Helicopter PilotsSimulate the pilot's greedy rule by checking reachability past forbidden points at each step and print the resulting hop sequence in run-length form. | Medium6 | Dynamic programmingGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| YahtzeeAssign thirteen dice rolls to thirteen Yahtzee categories, including the upper-section bonus, to maximize the total score. | Medium6 | Dynamic programmingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Lifeboat BalancingSplit all passengers into two boats with equal head counts (off by one when N is odd) so the two total weights differ as little as possible. | Medium6 | Dynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| WimbledonCompute the expected match length in minutes from each player's chance of winning a game on serve under best-of-five tennis scoring. | Medium6 | ProbabilityDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| ChompDecide whether each 3-row Chomp position is winning and output a move to a losing position. | Medium6 | Game theoryDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Klingon WarfarePick one subclan from each ordered clan tree so the pair matches in style, child count and sibling order with the largest size. | Medium6 | TreeHash map+1 | No attempts yet | 5s | 128 MB | Judgeable |
| Booking ErrorAdd the fewest new segments to the booked ticket so travel from start to destination uses the smallest number of stops the network allows. | Medium6 | Shortest pathDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Largest Subsequence NumberPick digits from N in order, without a leading zero, to form the largest value that leaves remainder R when divided by Q. | Medium6 | Dynamic programmingString+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Joy of the Cylinder GameChoose one cell in every row of the cylindrical grid within the step limit so the total is largest, and print the smallest best path. | Medium6 | Dynamic programmingSliding window | No attempts yet | 1s | 128 MB | Judgeable |
| Join the ConversationFind the longest chronological message chain where each message mentions the previous author, breaking ties by smallest indices. | Medium6 | Dynamic programmingHash map+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Mario KartMove between stations when a subset of coins meets the cost limit and matches the distance, and find the fewest moves from the first to the last station. | Medium6 | Dynamic programmingGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Stone Game 8Count pile sizes up to M where the second player wins a take-away game with a fixed move set. | Medium6 | Game theoryDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Genetically Modified AppleInsert priced letters into a DNA string so a given gene appears as a contiguous block at minimum total cost. | Medium6 | Dynamic programmingString matching | No attempts yet | 1s | 128 MB | Judgeable |
| BitTorrentChoose the most files whose covering fixed-size pieces fit in the bandwidth budget, where a piece shared by files is paid once. | Medium6 | Dynamic programmingPrefix sum | No attempts yet | 2s | 128 MB | Judgeable |
| Sum of LIS lengths over every consecutive subsequenceSum the LIS lengths of all contiguous subarrays for each test case of distinct integers. | Medium6 | Dynamic programmingBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BoosterCompute how many minutes up to K halve-one-edge boosters save on the fastest route from district 1 to district N. | Medium6 | Shortest pathDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Singapore TourStart at C, collect values from up to 14 grid spots with per-step cost 2, and return for the maximum net score. | Medium6 | Dynamic programmingBFS+1 | No attempts yet | 2s | 512 MB | Judgeable |
| LazycatFind the shortest walk on a grid with walls that starts at S, visits every food cell, then ends at the bed. | Medium6 | Dynamic programmingBFS+1 | No attempts yet | 2s | 512 MB | Judgeable |
| StreetChoose up to k non-overlapping blocks of at most t lots to maximize total block length times its minimum height limit. | Medium6 | Dynamic programmingIntervals | No attempts yet | 2s | 512 MB | Judgeable |
| GenomeFind the length of the longest sequence that appears as a subsequence in every given permutation. | Medium6 | GraphDynamic programming | No attempts yet | 2s | 512 MB | Judgeable |
| Filling a 4 × n Rectangle with DominoesCount the tilings of a 4 by n board with dominoes and print the count modulo 1000 without leading zeros. | Medium6 | Dynamic programmingCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| Longest Arithmetic ProgressionFind the length of the longest subsequence of the given sorted list that forms an arithmetic progression. | Medium6 | Dynamic programmingArray | No attempts yet | 2s | 1024 MB | Judgeable |
| Scout OutingScouts split along every DAG trail and regroup at each station; report the last arrival time, the total waiting spread, and the stations with departure slack. | Medium6 | Topological sortDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Secret CodeCount the sequences of operations that build the given string from a source of length at least 2 by gluing each string to a copy missing one end character. | Medium6 | Dynamic programmingString matching+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Mooo MooFind the fewest cows whose breed volumes explain the recorded volumes when each field spills its total minus one into the next field. | Medium6 | Dynamic programmingGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| OdometerCount the integers from X to Y with one digit occupying at least half of their decimal digits, ignoring leading zeros. | Medium6 | Dynamic programmingCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| IOI ManjuChoose boxes and fill them with the priciest manju so packed value minus box cost is as large as possible. | Medium6 | Dynamic programmingSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| OrchardPick one rectangle for Bert to minimize the bananas left outside it plus the apples inside it. | Medium6 | MatrixPrefix sum+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Decreasing Sequences of PointsCount sequences of lattice points on the diagonals x+y=a_i with nondecreasing x and nonincreasing y. | Medium6 | Dynamic programmingPrefix sum | No attempts yet | 1s | 256 MB | Judgeable |
| Lazy FoxStarting from the origin, visit neighbors so each hop is strictly shorter than the last and collect the maximum number of treats. | Medium6 | Dynamic programmingSorting+1 | No attempts yet | 1s | 256 MB | Judgeable |
| KCM TravelFind the fastest route from airport 1 to airport N using flights with costs and times without exceeding budget M, or report that it is impossible. | Medium6 | Dynamic programmingShortest path+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Driving license testMove only right and down from the top left corner to the bottom right corner with at most G fuel to arrive as early as possible. | Medium6 | Dynamic programmingGraph | No attempts yet | 2s | 256 MB | Judgeable |
| Ancient Cave ExpeditionFrom cave 1, choose a route that only moves deeper to maximize treasure values minus tunnel costs, breaking profit ties by lexicographic order. | Medium6 | Dynamic programmingTopological sort+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Lift ProblemsDecide the lift stops for given per-floor student counts to minimize total annoyance from stops and skipped floors. | Medium6 | Dynamic programmingPrefix sum | No attempts yet | 1s | 256 MB | Judgeable |
| Help CupidGiven N time zones, split everyone into pairs to minimize the total circular hour difference. | Medium6 | Dynamic programmingSorting | No attempts yet | 3s | 256 MB | Judgeable |
| Matryoshka DollsChoose and nest the most dolls so each doll carries its own weight plus every doll inside it. | Medium6 | Dynamic programmingSorting | No attempts yet | 1s | 256 MB | Judgeable |
| Number Picking GameAhyeon removes interior numbers one at a time, scores each pick plus its live neighbors, and maximizes the total score. | Medium6 | Dynamic programmingIntervals | No attempts yet | 1s | 256 MB | Judgeable |
| Unicycle countingFind the smallest number of arithmetic progressions that leave marks exactly at the observed road positions. | Medium6 | Dynamic programmingBit manipulation+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Digi Comp IIBalls fall through a DAG of toggle switches that flip after each visit, and the task is to report the final state of every switch. | Medium6 | Topological sortDynamic programming | No attempts yet | 7s | 256 MB | Judgeable |
| MAFIJAEach of N players accuses one other, and mobsters never accuse mobsters, so find the largest set with no internal accusation. | Medium6 | Dynamic programmingGraph | No attempts yet | 1s | 256 MB | Judgeable |
| Dorm PartyChoose up to K building resets over N daily move-ins to minimize the sum of current occupancy counts at each arrival. | Medium6 | Dynamic programmingGreedy+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Bob's House SiteCount the subrectangles of an N by M elevation grid whose covered cells all have equal height. | Medium6 | StackMatrix+1 | No attempts yet | 1s | 64 MB | Judgeable |
| Hill NumbersGiven N with up to 70 digits, count hill numbers smaller than N, or print -1 when N is not one. | Medium6 | Dynamic programmingCombinatorics | No attempts yet | 5s | 256 MB | Judgeable |
| Increasing NumbersFor each given number, print -1 unless its digits never decrease, else count smaller integers whose digits never decrease. | Medium6 | CombinatoricsDynamic programming | No attempts yet | 5s | 256 MB | Judgeable |
| Bulletproof Glass Testing BudgetCompute the minimum worst-case budget to find the exact breaking distance when each bullet and each broken pane costs money. | Medium6 | Dynamic programming | No attempts yet | 1s | 256 MB | Judgeable |
| Web Service DependenciesCount the launch orders that place each container after all of its dependencies for each configuration. | Medium6 | Dynamic programmingTopological sort+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Meeting TimeBessie and Elsie each choose a downhill route from field 1 to field N with their own edge times so both arrive at the same earliest moment. | Medium6 | Dynamic programmingGraph | No attempts yet | 1s | 256 MB | Judgeable |
| FouadCount distinct numbers divisible by 7 formed by using each given digit exactly once with no leading zero. | Medium6 | Dynamic programmingCombinatorics+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Cow HopscotchCount paths from the top-left to the bottom-right cell that step strictly down and right onto a different value, modulo 1000000007. | Medium6 | Dynamic programmingPrefix sum+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Bessie's Birthday BuffetChoose patches of strictly increasing quality and walk between them to maximize total quality gained minus E per step. | Medium6 | Dynamic programmingShortest path+1 | No attempts yet | 1s | 256 MB | Judgeable |