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 results1,340 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| SUPER SUPER BINARY SEARCH DELUXE 2.5: THE LEGEND OF THE GOLDEN MAZASSUMNIDA, EPISODE 2: THE MAZWAETL UNIVERSE, PART 2: THE PARALLEL UNIVERSE AND THE LOST MAZASSUMNIDA: GAME OF THE YEAR EDITIONPrint the first midpoint binary search picks on [1, 100], which is 50. | Easy1 | Binary searchImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| Song ScoresGiven cumulative durations of N song scores, answer Q queries asking which score is being sung at a given time using prefix sums and search. | Easy2 | Prefix sumBinary search+1 | No attempts yet | 2s | 128 MB | Judgeable |
| What Is My Grade?Given 50 distinct scores sorted in descending order and Hongik's score, print the letter grade matching his rank using the fixed cutoffs. | Easy2 | ArrayImplementation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Finding the RankGiven a sorted list of scores with a capacity limit, compute the rank of a new score or return -1 if the list is full and the score is not higher than the last entry. | Easy3 | ArrayImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Sum of Distinct NumbersGiven a sum S, find the largest number of distinct positive integers that can add up to exactly S. | Easy3 | MathBinary search+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Finding NumbersGiven N integers and M queries, output for each query whether it exists in the array, requiring an efficient lookup method. | Easy3 | Binary searchSorting+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Integer Square RootGiven an integer n up to 2^63-1, compute the smallest nonnegative integer q whose square is at least n. | Easy3 | Binary searchMath | No attempts yet | 0.4s | 128 MB | Judgeable |
| ICONSGiven N, find rows R and columns C with R<=C, R*C>=N, minimizing R+C, and output the most balanced such pair. | Easy3 | MathBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| iChessGiven counts of black and white tiles, find the largest square side length whose checkerboard pattern fits within those tile counts, or report impossibility. | Easy3 | Binary searchMath+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Internet Service ProvidersGiven N and C, find the smallest integer T minimizing/maximizing the quadratic profit N*T*(C-T*N), handling N=0 edge case. | Easy3 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Prime Gap SequenceGiven a number k, find the gap length between the two consecutive primes surrounding it if k is composite, otherwise output 0. | Easy3 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Too Much WaterGiven a property point, compute the hour when the growing semicircle centered at the origin first covers it, using the fixed 50 square meters per hour rate. | Easy3 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Ball BearingsGiven the inner diameter of an outer ring, the ball diameter, and the minimum gap between neighboring balls, find the maximum number of balls that fit. | Easy3 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PyramidsGiven N blocks, repeatedly take out the largest triangular number that fits, and print the resulting pyramid heights in decreasing order. | Easy3 | GreedyMath+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| HunterCount animals within range L of a firing position on the x-axis under distance |x - a| + b. | Easy3 | Binary searchSorting | No attempts yet | 1s | 128 MB | Judgeable |
| Fegla and the Bed BugsPlace K bugs on N line cells to maximize the smallest empty gap between neighbors. | Easy3 | Binary searchGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Paula's dress searchCount how many middle-shop visits Paula needs to reach the shop holding her dress. | Easy3 | SimulationBinary search | No attempts yet | 1s | 128 MB | Judgeable |
| Number CardsCheck each of M query integers against a set of N owned cards and print 1 for a match and 0 otherwise. | Easy3 | Hash mapBinary search | No attempts yet | 2s | 256 MB | Judgeable |
| There is no place like 127.0.0.1Replace each IPv4 address in the text with its mapped word from single entries and non-overlapping ranges, leaving unmatched addresses unchanged. | Easy3 | Binary searchSorting+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Stepping StonesMaximize the number of landed stones when jump lengths grow by at least one each time and the last landing is stone N. | Easy3 | MathBinary search | No attempts yet | 1s | 256 MB | Judgeable |
| Probability of winning a prizeGiven a and b, a comment's position is uniform on a+1 to b; find the probability it is a perfect square and print the reduced fraction. | Easy3 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hunt the RabbitFor each hidden rabbit position, print the sequence of envelope numbers a lower-middle binary search opens until it finds the rabbit. | Easy3 | Binary searchSimulation | No attempts yet | 2s | 512 MB | Judgeable |
| Riemann Sum Offset (Small)For a linear polynomial, find the offset epsilon in [0, dx] that makes the Riemann sum equal the exact integral, or print -1. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Äventyr 1On a path 1 to N, vertices become active over time; after each activation, answer the distance from a query vertex to the nearest active vertex, or -1 if none exists yet. | Easy3 | ArraySorting+2 | No attempts yet | 1s | 256 MB | Judgeable |
| 2018 Yonsei University Programming ContestGiven the total spark count N of a firework that bursts once then bursts again, find the branching factor K. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BeondegiGiven A players in a circle and a chant pattern by rounds, find who makes the T-th call of a chosen word (ppeon or degi), counting only that word. | Easy3 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Predictable QueueGiven N task times and M time limits T, print how many tasks are processed first in order before their prefix sum exceeds T. | Easy3 | Prefix sumBinary search | No attempts yet | 1s | 512 MB | Judgeable |
| Server RoomAir rises one unit per minute from the bottom of an N x N grid of stacked computers; find the earliest minute when at least half of all computers are cooled. | Easy3 | SortingBinary search+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Expeditious CubingGiven four of Claire's five solve times and a target final score (average of the middle three), find the largest fifth solve time that still meets the target, or report impossible or infinite. | Easy3 | MathSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Please Write the If Statements for MeGiven N titles ordered by increasing power upper bounds, print for each of M power values the first title whose bound is at least that value. | Easy3 | Binary searchArray+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Endless StringStarting from a string A, repeatedly replace every $ in S with the previous result, then print characters from position min to max after N runs. | Medium4 | StringRecursion+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Raising the Win RateGiven total games X and wins Y, find the minimum extra consecutive wins needed to raise the floor(100*Y/X) displayed win rate, or report -1 if impossible. | Medium4 | MathBinary search+1 | No attempts yet | 2s | 128 MB | Judgeable |
| GiftsFind the maximum cube side length A so that N cubes of size A can fit inside an L×W×H box, using binary search on A. | Medium4 | Binary searchMath | No attempts yet | 2s | 128 MB | Judgeable |
| Building Rest StopsGiven existing rest stops on a highway, place M new integer-position stops to minimize the longest gap between consecutive stops, found via binary search. | Medium4 | Binary searchGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Cable CuttingGiven K cable lengths, binary search the maximum integer cut length so that summing floor(length/cut) over all cables reaches at least N pieces. | Medium4 | Binary searchGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| K-th Digit in a Concatenated Number StringGiven N and k, find the k-th digit in the concatenation of integers 1 through N, or -1 if the string is shorter than k. | Medium4 | MathBinary search+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Box NestingFind the length of the longest strictly increasing subsequence of box sizes given in order. | Medium4 | Dynamic programmingBinary search+1 | No attempts yet | 2s | 128 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 |
| 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 |
| Find the Binary NumberGiven N, L, and I, output the I-th binary string of length N (with at most L ones) in increasing numeric order. | Medium4 | CombinatoricsBinary search+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Guitar LessonSplit an ordered array into M contiguous groups so the maximum group sum is as small as possible, using binary search on the answer. | Medium4 | Binary searchGreedy+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Semiconductor DesignGiven a permutation of port connections, find the longest increasing subsequence to avoid crossing lines. | Medium4 | Dynamic programmingBinary search | 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 |
| Budget AllocationGiven budget requests and a total cap, find the maximum integer cap value such that capping requests at that value keeps the total within budget. | Medium4 | Binary searchGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Tree CuttingBinary search for the maximum saw height H so that trimming all trees above H yields at least M meters of wood total. | Medium4 | Binary searchGreedy | No attempts yet | 1s | 256 MB | Judgeable |
| Bridging SignalsGiven a permutation of wire connections between two ports, find the longest increasing subsequence to maximize non-crossing signals. | Medium4 | Binary searchDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Immigration InspectionGiven N counters with per-person processing times and M travelers, find the minimum time to process everyone using binary search on the answer. | Medium4 | Binary searchMath | No attempts yet | 1s | 128 MB | Judgeable |
| ClassGiven n students and an r by c grid of desks, find the maximum achievable value k such that some row and some column can each have k occupied desks. | Medium4 | MathGreedy+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Rising TrendFor each test case, compute the length of the longest strictly increasing subsequence in a sequence of up to 100000 prices. | Medium4 | Dynamic programmingBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cube RootCompute the cube root of very large integers (up to 150 digits) truncated to 10 decimal places, for multiple test cases. | Medium4 | MathBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Trick or TreatFind the point on the x-axis minimizing the maximum distance to a set of given points, an application of ternary search on a convex function. | Medium4 | Binary searchMath+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 |
| 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 |
| PseudoprimeFor each pair p and a, decide whether p is composite and satisfies a^p mod p == a, printing yes or no. | Medium4 | MathNumber theory+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RootFor each pair B and N, find the positive integer A that makes A^N as close to B as possible. | Medium4 | Binary searchMath+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 |
| 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 |
| 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 |
| Long Distance RacingGiven a terrain string and per-unit times, find the farthest segment index k whose round-trip time stays within M seconds. | Medium4 | ArrayPrefix sum+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hungry CowsGiven a sequence of N cow brands, find the length of the longest strictly increasing subsequence in the given order. | Medium4 | Dynamic programmingBinary search+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Intergalactic MortgageSimulate monthly compound interest at r/12 percent on a debt, subtract a fixed payment, and report whether the balance reaches zero within N years. | Medium4 | SimulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Overlapping MapsGiven a smaller rotated, scaled map lying inside a larger one, find the unique point that represents the same location on both maps. | Medium4 | GeometryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Making a BoxGiven a square panel of side a, find the corner cut b in (0, a/2) that maximizes the open box volume b(a-2b)^2. | Medium4 | MathBinary search | No attempts yet | 1s | 128 MB | Judgeable |
| To Eat or Be EatenCount pairs where an A creature is strictly larger than a B creature, given two lists of sizes. | Medium4 | SortingTwo pointers+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Longest Ordered SubsequenceGiven a sequence of N integers, find the length of the longest non-decreasing subsequence. | Medium4 | Dynamic programmingArray+2 | No attempts yet | 1s | 128 MB | Judgeable |
| CalendarsConvert each given date to its day of year with one calendar, then locate the matching month and day in the other calendar. | Medium4 | Prefix sumBinary search | No attempts yet | 1s | 512 MB | Judgeable |
| Missile ProtectorSelect the most missiles that form a non-decreasing height sequence in arrival order. | Medium4 | Dynamic programmingBinary search | No attempts yet | 1s | 128 MB | Judgeable |
| Starship Hakodate-maruGiven a limit up to 151200, find the largest amount that splits into a cube plus a tetrahedral number. | Medium4 | Brute forceSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Rate of ReturnFind the monthly rate that makes the compounded deposits equal the reported fund value. | Medium4 | Binary searchMath | No attempts yet | 1s | 128 MB | Judgeable |
| Euclidean TSPPick c to minimize the sum of the approximation runtime and the lengthened tour flight time, and print the best time and c. | Medium4 | Binary searchMath | No attempts yet | 1s | 256 MB | Judgeable |
| Longest Increasing SubsequenceFind the length of the longest strictly increasing subsequence of the given sequence. | Medium4 | Dynamic programmingBinary search | No attempts yet | 1s | 256 MB | Judgeable |
| Mingyun's SchemeGiven N cards in order, compute the length of the longest strictly increasing subsequence. | Medium4 | Dynamic programmingBinary search | No attempts yet | 1s | 256 MB | Judgeable |
| Points on a SegmentCount how many of N distinct points fall inside each of M closed intervals on a line. | Medium4 | Binary searchSorting | No attempts yet | 1s | 256 MB | Judgeable |
| Odd Even SequenceFind the Nth term of the increasing sequence formed by blocks of 1 odd, 2 evens, 3 odds, and so on. | Medium4 | MathBinary search | No attempts yet | 2s | 256 MB | Judgeable |
| Angry Cows (Silver)Find the smallest integer blast radius R so K intervals of length 2R cover all N hay bale positions on a line. | Medium4 | Binary searchGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Stock Purchase PlanFor each test case, decide whether the daily prices contain a strictly increasing subsequence of length K. | Medium4 | Dynamic programmingBinary search | No attempts yet | 5s | 512 MB | Judgeable |
| Longest Increasing Subsequence 2Given up to 1,000,000 numbers, compute the length of the longest strictly increasing subsequence. | Medium4 | Binary searchDynamic programming | No attempts yet | 1s | 512 MB | Judgeable |
| DolphinGiven a position n, print the n-th phrase in the repeating block-based dolphin sequence. | Medium4 | MathBinary search+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Coast GuardDecide whether a coast guard boat can intercept a thief heading straight out to sea 12 miles away, given their speeds and starting distance apart. | Medium4 | GeometryMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Ax+Bsin(x)=CGiven A, B, C with B <= A, find the unique real x solving Ax + B*sin(x) = C, rounded to six decimals. | Medium4 | Binary searchMath | No attempts yet | 2s | 512 MB | Judgeable |
| Counting HaybalesGiven N distinct haybale positions and Q interval queries, count how many positions fall inside each inclusive range [A, B]. | Medium4 | SortingBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Box PackingGiven box sizes in order, find the longest subsequence where each box is strictly smaller than the next, counting boxes in the pile. | Medium4 | Dynamic programmingBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Rebel Against The Empire (Small)Given stationary points in 3D, find the smallest jump radius that lets you reach asteroid 1 from asteroid 0, ignoring the time limit. | Medium4 | GraphUnion-find+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Need for SpeedGiven segment distances and speedometer readings plus a total time, find the constant offset c making the summed travel times equal t. | Medium4 | Binary searchMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| The TA is a sadist!!Given a permutation of 1 to N, find the minimum number of elements to remove so the remaining values increase from front to back. | Medium4 | Dynamic programmingBinary search+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Ax+Bsin(x)=C IIFind the unique positive x with Ax + B sin(x) = C, given 0 < B <= A, and print it to nine decimals. | Medium4 | Binary searchMath | No attempts yet | 2s | 512 MB | Judgeable |
| Halfway PointGiven n, find the value printed when the pair-comparison loop reaches its halfway point (the last item index printed there). | Medium4 | Binary searchMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Heart RateGiven a beat count b over p seconds, find the lower and upper bounds on the constant-interval heart rate that could produce it, plus the estimate 60b/p. | Medium4 | MathImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Wizard of OddsGiven N possible secret numbers and K yes/no questions, decide whether K adaptive questions always identify the number, where K questions distinguish at most 2^K outcomes. | Medium4 | MathBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Heroes of the Storm ProgamerGiven N character levels and a total increase K, raise levels to maximize the minimum of the chosen sequence. | Medium4 | GreedySorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Two ArraysFor each element of A, find the element of B closest in value (smallest on ties) and print the sum of these chosen values. | Medium4 | Binary searchSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Cap SizeGiven cap sizes tried on with fit feedback, count how many untried sizes could still fit, or report inconsistent feedback. | Medium4 | ImplementationSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Dome ConstructionGiven n points in 3D with non-negative y, find the minimum radius of a dome (hemisphere on the xz-plane) that contains at least k of them. | Medium4 | Binary searchGeometry+2 | No attempts yet | 2s | 512 MB | Judgeable |
| MooBuzzGiven N up to 1e9, find the Nth positive integer that is not a multiple of 3 or 5, since those turns are replaced by Moo. | Medium4 | MathBinary search+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Where Am I?Given a string of N mailbox colors, find the smallest K such that all length-K substrings are distinct. The answer is always at most N. | Medium4 | StringBrute force+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Round TripA runner travels out and back along N courses given by their lengths; given total distance K, print which course the runner is on or about to enter. | Medium4 | ArrayPrefix sum+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Arranging SoldiersGiven a sequence of N combat powers, find the minimum number of soldiers to remove so the remaining values are in strictly decreasing order. | Medium4 | Dynamic programmingArray+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Coordinate CompressionFor each of N coordinates, output the number of distinct values smaller than it, which is its rank under coordinate compression. | Medium4 | SortingHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| K-th NumberFind the k-th smallest value in the N x N multiplication table using binary search with a counting function. | Medium5 | Binary searchMath | No attempts yet | 2s | 128 MB | Judgeable |
| Tangled Electric WiresGiven a matching between left and right poles, find the minimum number of wires to cut so no two remaining wires cross, which reduces to computing N minus the longest increasing subsequence. | Medium5 | Dynamic programmingBinary search+1 | No attempts yet | 1s | 128 MB | Judgeable |