Curated sets
Math and counting
Number theory, combinatorics, and geometry.
Total results6,670 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| A debugging life that starts with std::sortPrint N = 2 and the two points (1, 0) and (0, 1), a fixed counterexample for a broken comparator in std::sort. | Easy1 | ImplementationSorting+2 | No attempts yet | 2s | 512 MB | Judgeable |
| The Merchant of VeniceSum the cargo values of all ships whose distance is at most s*d, the distance they can cover by the due date. | Easy1 | ImplementationMath | No attempts yet | 2s | 512 MB | Judgeable |
| Grass Seed Inc.Given the cost per square metre and a list of rectangular lawns, print the total cost of seeding all of them, rounded to seven decimals. | Easy1 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Equality CheckRead a quiz line formatted as 'a + b = c' and print YES if a + b equals c, otherwise NO. | Easy1 | ImplementationMath | No attempts yet | 1s | 512 MB | Judgeable |
| TunaFor each tuna, take the larger of two estimates when they differ by at most X, otherwise take a third estimate, and print the sum. | Easy1 | ImplementationMath | No attempts yet | 1s | 64 MB | Judgeable |
| Two Chickens (...)Given two account balances and the price of one chicken, print the leftover total if two chickens can be afforded, otherwise the current total. | Easy1 | ImplementationMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| The Y Bus Goes VroomSimulate the passenger count as a bus travels N stops with given boarding and alighting numbers, then print the driver's fixed name. | Easy1 | SimulationImplementation+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Pick the QuadrantRead the x and y coordinates of a nonzero point and print which of the four quadrants it lies in. | Easy1 | ImplementationMath | No attempts yet | 1s | 512 MB | Judgeable |
| Shifty SumGiven N and k, print N + 10N + ... + 10^k N. | Easy1 | MathImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| Polynomial Derivative (Small)Given the nonzero terms of a polynomial, compute the value of its derivative at x = 1. | Easy1 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FizzBuzzPrint the numbers 1 through N, writing Fizz for multiples of X, Buzz for multiples of Y, and FizzBuzz for multiples of both. | Easy1 | ImplementationMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| AdditionRead two integers between -100,000 and 100,000 and print their sum. | Easy1 | MathImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| Judging MooseGiven the tine counts on each side, print the moose's score as Even x, Odd x, or Not a moose when both sides are zero. | Easy1 | ImplementationMath | No attempts yet | 1s | 512 MB | Judgeable |
| Hard choiceGiven prepared and requested counts for chicken, beef, and pasta, count passengers whose requested meal is unavailable. | Easy1 | MathImplementation | No attempts yet | 1s | 1024 MB | Judgeable |
| Every Second CountsGiven a start and end clock time, compute how many seconds elapsed, adding 24 hours if the ride crosses midnight. | Easy1 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| AnglesFor each triple of angles, print the numbers and say whether they sum to 180. | Easy1 | ImplementationMath | No attempts yet | 2s | 512 MB | Judgeable |
| Chanukah CandlesEach evening needs one more candle than the last plus one shammas, so for N days compute N(N+1)/2 + N. | Easy1 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Sim CardFor each student, compute the smallest total cost of call minutes and data across the three fixed operator price plans. | Easy1 | ImplementationBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Vera's FashionGiven N tops and N bottoms colored 1 to N, count how many top and bottom pairs have different colors. | Easy1 | MathCombinatorics+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Fast A+BRead T pairs of integers from fast input and print each sum on its own line. | Easy1 | ImplementationMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Sum of N integersRead N integers and print their sum, which needs a 64-bit integer type. | Easy1 | ImplementationMath | No attempts yet | 0.1s | 512 MB | Judgeable |
| The group project starts and the team leader is goneGiven a distance L, Sungwoo covers 1 to 5 per minute; print the smallest integer number of minutes needed to reach Mingeon. | Easy1 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Helmet and VestGiven a list of helmet defense values and a list of vest values, print the sum of the best helmet and the best vest. | Easy1 | ArrayImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Hansu NumbersCount integers from 1 to N (N up to 1000) whose digits form an arithmetic sequence. | Easy2 | ImplementationBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Make It DivisibleFind the smallest two-digit replacement (00-99) for the last two digits of N that makes N divisible by F. | Easy2 | Brute forceMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Octal to BinaryConvert a huge octal number (up to 333,334 digits) into its binary representation without leading zeros. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Sign of Integer SumsFor three separate lists of integers, compute each sum and print whether it is positive, negative, or zero, handling values up to 64-bit signed range. | Easy2 | ImplementationMath | No attempts yet | 2s | 256 MB | Judgeable |
| Mobile Phone BillGiven up to 20 call durations, compute total cost under two per-block billing plans and print the cheaper one with its cost. | Easy2 | SimulationImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| House Number SignCompute the total width of a house-number sign given fixed per-digit widths and 1 cm margins between digits and at both ends, for each input number until 0 appears. | Easy2 | ImplementationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Easy Sequence SumGiven a sequence where each integer k repeats k times, compute the sum of terms between positions A and B. | Easy2 | MathSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| TV SizeGiven a TV's diagonal length and height-to-width ratio, compute the actual height and width, flooring non-integer results. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Year Progress BarGiven a date and time string, compute what percentage of the current year (accounting for leap years) has elapsed. | Easy2 | ImplementationMath | No attempts yet | 2s | 128 MB | Judgeable |
| Actual Disk SpaceGiven N file sizes and a cluster size, compute total disk space used by rounding each file up to the nearest cluster multiple and summing. | Easy2 | MathImplementation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Reversed AdditionReverse the digits of two numbers up to 1000, add the reversed values, then reverse the sum and print the result. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| 24-Hour MissionGiven the current time and a start time in HH:MM:SS, compute the time remaining until the start time next occurs within a 24-hour cycle. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Time MachineGiven three two-digit numbers from a digital clock, count how many of the 6 permutations form a valid HH:MM:SS time. | Easy2 | CombinatoricsBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Room NumberGiven a room number, count how many plastic digit sets (0-9 each) are needed, treating 6 and 9 as interchangeable when flipped. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Adjusted AverageGiven N exam scores, rescale each by dividing by the maximum score and multiplying by 100, then output the average of the rescaled scores. | Easy2 | ArrayMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Manhattan Distance on a Four-Row Number BoardGiven two numbers placed column by column in a 4-row grid, compute the Manhattan distance between their cell positions. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Chicken CouponsGiven n chicken coupons and a stamp-to-coupon exchange rate k, compute the maximum chickens obtainable by repeatedly redeeming stamps for new coupons. | Easy2 | MathSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Growth PointsSimulate a tree that multiplies its leaves by a yearly factor then subtracts pruned branches, and report the final leaf count. | Easy2 | SimulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Break-Even PointGiven fixed cost A, variable cost B, and price C, find the smallest number of laptops where revenue exceeds total cost, or -1 if impossible. | Easy2 | MathImplementation | No attempts yet | 0.35s | 128 MB | Judgeable |
| Next Term in a SequenceGiven a sequence that is either arithmetic or geometric, determine which type it is and output its next term. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Fraction SumAdd two given fractions and output the sum reduced to lowest terms using GCD. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Concatenating Numbers 1Compute the total digit count when integers from 1 to N are written consecutively without spaces. | Easy2 | MathImplementation | No attempts yet | 0.15s | 128 MB | Judgeable |
| Numbers With Equal Remainder and QuotientGiven N, find the sum of all positive integers x whose quotient and remainder are equal when divided by N. | Easy2 | Math | No attempts yet | 2s | 256 MB | Judgeable |
| Octopus NumbersConvert base-8 strings using nine special symbols (including one for digit -1) into their decimal integer values until a terminator line appears. | Easy2 | StringMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Good License PlatesFor each license plate, compute a base-26 value from the three letters and compare it to the four-digit number, printing whether their difference is within 100. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Fourth PointGiven two adjacent sides of a parallelogram as endpoint coordinates, compute and print the fourth vertex for each line of input. | Easy2 | GeometryMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Year 2007Given a month and day in 2007, compute and print the corresponding day of the week starting from Monday, Jan 1. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Least Common MultipleFor each of up to 1000 pairs of numbers, compute and print the least common multiple. | Easy2 | MathNumber theory | No attempts yet | 1s | 128 MB | Judgeable |
| Counting Pentagon PointsCompute the total pentagonal points after N steps using a simple arithmetic formula, modulo 45678. | Easy2 | MathImplementation | No attempts yet | 2s | 256 MB | Judgeable |
| Perfect SquaresGiven two numbers M and N up to 10000, sum all perfect squares in that inclusive range and print the smallest one, or -1 if none exist. | Easy2 | MathBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Counting PrimesCount how many of up to 100 given numbers (each at most 1000) are prime. | Easy2 | MathBrute force | No attempts yet | 2s | 128 MB | Judgeable |
| PlugsGiven N power strips each with a plug capacity, compute the max number of computers powered when strips are chained from one wall outlet. | Easy2 | MathGreedy+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Self-Replicating NumberCheck whether squaring an integer N reproduces N as the trailing digits of N squared. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Day of the YearGiven day, month, year, compute the day's ordinal number within that year accounting for leap years, until a 0 0 0 terminator. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Number GameRepeatedly sum decimal digits of each number until one digit remains, processing lines until a terminating zero. | Easy2 | MathImplementation | No attempts yet | 2s | 128 MB | Judgeable |
| Prime WordSum letter values (a-z=1-26, A-Z=27-52) for a word and print whether the sum is prime (with 1 counted as prime). | Easy2 | StringMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Restoring NumbersFor each given integer up to 100,000, output its prime factorization as prime-exponent pairs in increasing order. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Sum of Consecutive IntegersGiven two integers, print the sum of all integers in the closed range between them, handling either order. | Easy2 | MathImplementation | No attempts yet | 0.25s | 128 MB | Judgeable |
| Find the K-th DivisorGiven N and K, find and print the K-th smallest divisor of N, or 0 if it doesn't exist. | Easy2 | MathBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| AI Oven ClockGiven a start time in hours, minutes, seconds and a duration in seconds, compute the finishing time on a 24-hour clock that wraps around. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Candy Teacher Go ChangyoungCheck whether the total number of candies among N students can be evenly divided among them (sum divisible by N). | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Digit Counts in a ProductGiven three 3-digit natural numbers, compute their product and count how many times each digit 0 to 9 appears in it. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Greatest Common Divisor and Least Common MultipleGiven two natural numbers up to 10000, output their greatest common divisor and least common multiple. | Easy2 | MathNumber theory | No attempts yet | 1s | 128 MB | Judgeable |
| U.S. Unit ConversionConvert given values between kilograms/pounds and liters/gallons using fixed conversion factors, rounding to four decimal places. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Laundry Owner DonghyukGiven a number of cents, output the minimum count of quarters, dimes, nickels, and pennies using a greedy coin breakdown. | Easy2 | GreedyMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Weighted Triangular SumCompute a weighted sum of triangular numbers W(n) for up to 300 test cases using a direct formula or loop. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Binary AdditionAdd two binary strings up to length 80 for multiple test cases and print the sum without leading zeros. | Easy2 | StringSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Base ConversionConvert a number given in an arbitrary base (2 to 36, using letters for digits above 9) into its decimal value. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Fibonacci Number 2Compute the nth Fibonacci number for n up to 90. | Easy2 | Dynamic programmingMath | No attempts yet | 1s | 128 MB | Judgeable |
| What Is This Semester's GPA?Compute a weighted GPA from a list of courses, credits, and letter grades, rounded to two decimal places. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Triangular Gimbap Price ComparisonGiven several price rates for gimbap, compute the cheapest cost to buy exactly 1000 grams using the best per-gram rate among all stores. | Easy2 | MathGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Sugar DeliveryFind the minimum number of 3kg and 5kg bags that sum to exactly N kilograms, or -1 if impossible. | Easy2 | GreedyMath | No attempts yet | 1s | 128 MB | Judgeable |
| Climbing SnailCompute the number of days for a snail climbing A meters by day and sliding B meters by night to reach a pole of height V. | Easy2 | MathSimulation | No attempts yet | 0.25s | 128 MB | Judgeable |
| CopyrightGiven A songs and a rounded-up average I, find the smallest total copyrighted melodies consistent with ceil(total/A) = I. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| DominoesGiven N, compute the total dot count across all unique dominoes with halves ranging from 0 to N. | Easy2 | MathCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| Year 2009Given a day and month in the year 2009, output the English name of the weekday for that date. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Chessboard PiecesGiven N straight guillotine cuts through a rectangular board, compute the maximum number of resulting pieces. | Easy2 | MathGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Fourth PointGiven three corners of an axis-aligned rectangle, compute the coordinates of the missing fourth corner. | Easy2 | GeometryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Time Until the WarningGiven current time and a future warning time in a day, compute the wait time as a difference modulo 24 hours, printing 24:00:00 if they match. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Angry ChangyoungFor each match length, decide if it fits diagonally inside a W by H rectangle and print DA or NE accordingly. | Easy2 | GeometryMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 15-Puzzle DisplacementCompute the total Manhattan distance of each labeled tile from its position in the solved 4x4 15-puzzle board. | Easy2 | ArrayMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Number ReversalFor each number, reverse its digits, add to the original, and print YES if the sum is a palindrome, else NO. | Easy2 | StringMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hyunwoo the ProfessorFor each given N, output the number of trailing zeros in N! by counting factors of 5. | Easy2 | Math | No attempts yet | 1s | 128 MB | Judgeable |
| Automated Telephone ExchangeGiven a 3-digit exchange index n, count pairs of two-digit numbers a,b (00-99) such that n - a - b = 0. | Easy2 | Brute forceMath | No attempts yet | 1s | 128 MB | Judgeable |
| FlatGiven room areas and types, compute total area, total bedroom area, and flat cost using half-weighted balcony area. | Easy2 | ImplementationMath | No attempts yet | 3s | 256 MB | Judgeable |
| K-Graph OddityCompute the maximum vertex degree in a graph and output the smallest odd integer greater than or equal to it. | Easy2 | GraphImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cutting a BlockGiven a box and n, print the coordinates of n equal slabs formed by evenly spaced cuts along the x-axis, each rounded to 8 decimals. | Easy2 | MathSimulation+1 | No attempts yet | 2s | 64 MB | Judgeable |
| Right TriangleRead triples of side lengths until 0 0 0, and print right if the squares of the two shorter sides sum to the square of the longest, else wrong. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| LogoTrack a turtle's position and heading through forward, backward, left, and right commands, then report the rounded distance from the start. | Easy2 | SimulationGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| AFC WimbledonGiven the sum and difference of two non-negative scores, print the larger score first, or -1 if no such scores exist. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Combination LockGiven the dial position and three combination numbers, sum the degrees turned clockwise and counter-clockwise to open the lock. | Easy2 | SimulationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Above AverageFor each class, compute the average score and print the percentage of students scoring strictly above it, rounded to three decimals. | Easy2 | MathImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| Time ZonesGiven a time and two time zone abbreviations, compute the equivalent wall-clock time in the second zone. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Dog & GopherGiven the gopher's position, the dog's position, and a list of holes, find the first hole the gopher reaches no later than the dog. | Easy2 | ImplementationGeometry | No attempts yet | 1s | 128 MB | Judgeable |
| War for Middle-earthFor each battle, compute the weighted score of both armies from six and seven race counts and report the winner or a tie. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| Tetrahedral Stacks of CannonballsFor each of n queries, read the base side length and print the problem number, the side length, and the total cannonballs in a tetrahedral stack of that size. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bubble Gum, Bubble Gum, in the Dish, How Many Pieces Do You Wish?Given a list of names arranged in a circle, a starting person, and a count n, find who is at position n in the count. | Easy2 | ArraySimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |