Curated sets
Math and counting
Number theory, combinatorics, and geometry.
Total results6,670 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Base ConversionConvert the given number written in base A into base B and print its digits separated by spaces. | Easy2 | MathImplementation | No attempts yet | 2s | 256 MB | Judgeable |
| Stand on ZanzibarThe program adds yearly increases beyond twice the previous count to bound the number of imported turtles. | Easy2 | MathImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| Scaling RecipesScale each recipe from the main ingredient weight and baker percentages, then print every scaled weight rounded half up to one decimal. | Easy2 | ImplementationMath | No attempts yet | 3s | 256 MB | Judgeable |
| Dice CupFind the most likely sums of an N-sided and an M-sided die, printing every tied sum from lowest to highest. | Easy2 | Brute forceMath | No attempts yet | 1s | 256 MB | Judgeable |
| Turn Direction of Three PointsGiven three points in order, print 1, -1, or 0 depending on whether the path turns left, turns right, or runs straight. | Easy2 | Geometry | No attempts yet | 1s | 256 MB | Judgeable |
| Bottled-Up FeelingsFind counts of two bottle sizes that sum exactly to the shipment volume with the fewest bottles, or report Impossible. | Easy2 | Brute forceMath | No attempts yet | 1s | 256 MB | Judgeable |
| Lost ExponentsSplit each integer into a base from all but the last digit and an exponent from the last digit, then print the sum of the powers. | Easy2 | MathImplementation | No attempts yet | 1s | 64 MB | Judgeable |
| Donation PackagingTrack the stock of three relief sets day by day, ship every packable trio once at least 30 are ready, and print the shipped count or NO. | Easy2 | SimulationMath | No attempts yet | 1s | 256 MB | Judgeable |
| Octal, Decimal, HexadecimalConvert one integer given in octal, decimal, or hexadecimal notation to its decimal value. | Easy2 | ImplementationMath | No attempts yet | 1s | 256 MB | Judgeable |
| Promotion CountingFrom the before and after head counts in the four divisions, recover the number promoted across each of the three boundaries. | Easy2 | Math | No attempts yet | 2s | 512 MB | Judgeable |
| Lazy Spelling Bee (Large)Count distinct words formed by picking each letter from its neighbors in the target word, modulo 1e9+7. | Easy2 | CombinatoricsString+1 | No attempts yet | 5s | 512 MB | Judgeable |
| gWheels (Small)Decide if any pedal gear, two distinct extra gears, and tire gear combine to each target ratio P/Q. | Easy2 | Brute forceMath | No attempts yet | 5s | 512 MB | Judgeable |
| Hangul Initial ConsonantsPrint the initial consonant of each Hangul syllable in the given string in order. | Easy2 | MathString+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Dreary Design (Small)Count RGB triples with each component in 0 to K whose largest and smallest values differ by at most V. | Easy2 | Brute forceMath | No attempts yet | 5s | 512 MB | Judgeable |
| Fair and Square (Small)Count numbers in each interval [A, B] that are palindromes and squares of palindromes. | Easy2 | Brute forceMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Hedgemony (Small)Simulate a single left-to-right pass that trims each bush to the average of its current neighbors and output the final height of bush N-1. | Easy2 | SimulationMath | No attempts yet | 5s | 512 MB | Judgeable |
| Dr. Spaceman's height algorithmCompute a child height range from both parents' heights and the child sex, then round both ends inward to whole inches. | Easy2 | ImplementationMath | No attempts yet | 5s | 512 MB | Judgeable |
| Quake Live (Small2)Split the given players into two equal teams so the two skill totals differ as little as possible. | Easy2 | Brute forceCombinatorics | No attempts yet | 5s | 512 MB | Judgeable |
| Immigrate to the CTP principalityConvert each item between uppercase letters and their alphabet positions (A=1 to Z=26), in the direction given by the mode character. | Easy2 | ImplementationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tojaengi's Walk to SchoolCount monotone lattice paths from (1,1) to (w,h) that pass through a given shop, modulo 1000007. | Easy2 | CombinatoricsMath | No attempts yet | 1s | 128 MB | Judgeable |
| Mini Fantasy WarFor each character, add gear changes to the four base stats, clamp HP and MP to at least 1 and attack to at least 0, then print the weighted combat power. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| XORXORXORXOR the value B into A exactly C times and print the result. | Easy2 | Bit manipulationMath | No attempts yet | 0.2s | 512 MB | Judgeable |
| Changyong's ClockTrack a clock's time on a 24-hour dial, turning it forward or backward by c seconds and answering queries for the current time. | Easy2 | SimulationMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| LobbyGiven the seat counts of two parties, find how many independents must vote yes for a strict majority. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Three SumsFor each N, print the sum of the first N positive integers, the first N odd numbers, and the first N even numbers. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| FormulaGiven triangle vertex coordinates and a measured incircle radius, compute the radius from the formula and print the percentage difference. | Easy2 | GeometryMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Manhattan TaxiGiven your waiting intersection and up to 100 taxi positions on a 100x100 grid, print the coordinates of the taxi with the smallest Manhattan distance. | Easy2 | ImplementationBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| MatchesFor each match length, decide whether it fits in a W by H box, meaning its length is at most the diagonal sqrt(W^2+H^2). | Easy2 | GeometryMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Divisor CountFor each of up to 10 values of n below 10000, print n and its divisor count. | Easy2 | Number theoryBrute force | No attempts yet | 2s | 512 MB | Judgeable |
| The real Manhattan distanceGiven two points (x, y, floor), compute the walking distance: down from each floor, plus Manhattan street distance. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Collatz SequenceStarting from n, repeatedly apply the Collatz rule (halve evens, 3n+1 for odds) and print every value from n down to 1 on one line. | Easy2 | SimulationImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| ChessboardPrint an N by M grid of asterisks and dots where the top left cell is an asterisk and adjacent cells always differ. | Easy2 | ArrayImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Least Common MultipleGiven two integers below 100,000,000, print their least common multiple, which can exceed the 32-bit range. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Quick EstimatesRead N integers up to 10^100 and print the number of digits in each, counting 0 as one digit. | Easy2 | StringMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Room AssignmentCount boys and girls per grade and sum the ceiling of each count divided by the room capacity K. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Jumbled CompassGiven two compass directions from 0 to 359, print the signed rotation with the smallest magnitude that moves the needle from the first direction to the second, breaking ties toward clockwise. | Easy2 | MathImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Math ContestGiven a huge decimal integer x, print YES if x is divisible by 9 and NO otherwise. | Easy2 | Number theoryMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Four Arithmetic OperationsEach line gives an expression a op b = c with single-digit spacing, and you print correct or wrong answer depending on whether the arithmetic matches the claimed result. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Anniversary CakeGiven a rectangle and two interior candles, output the specific cut described by a fixed rule that separates the candles. | Easy2 | GeometryImplementation+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Data PlanTrack monthly data allowance that rolls over, subtract each month's usage, and report the megabytes available in month N+1. | Easy2 | ImplementationMath | No attempts yet | 1s | 64 MB | Judgeable |
| Cleaning StationsGiven weights and a feature matrix, print the indices of the rows whose weighted sum is largest, in ascending order, for each of K data sets. | Easy2 | ImplementationArray+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Walking in timeGiven three credit values, decide whether choosing some of them with signs (+ or -) sums to zero using at least one credit. | Easy2 | Brute forceMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Alarm ClockFor each case, compute how many minutes pass from the current time until the alarm time, rolling over to the next day when needed. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Dividing NlogôniaGiven a divider point, classify each house coordinate into one of four quadrants or as lying on a dividing line. | Easy2 | ImplementationMath | No attempts yet | 2s | 512 MB | Judgeable |
| Pokemon GOFor each species, compute how many net 10-candy evolutions are possible, sum them, and find the species with the most evolutions. | Easy2 | MathImplementation | No attempts yet | 1s | 32 MB | Judgeable |
| Olympic GamesFor each year, decide whether it is a summer Olympic year, and if so whether the games were held, cancelled by a war, or not yet assigned a city. | Easy2 | ImplementationMath | No attempts yet | 2s | 512 MB | Judgeable |
| Splitting into Two TeamsGiven four sorted skill levels, split them into two pairs of two and print the smallest possible difference between the two pair sums. | Easy2 | Brute forceMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Unit ConversionGiven x of unit A equals y of unit B, convert each listed amount to the other unit and print the result to six decimals. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| FuelConvert fuel consumption from miles per gallon to liters per 100 kilometers using the given conversion constants. | Easy2 | MathImplementation | No attempts yet | 1s | 512 MB | Judgeable |
| Luhn AlgorithmGiven a sixteen-digit card number as a string, check whether it passes the Luhn checksum and print DA or NE. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| TelephoneFind the base between 2 and 10 whose representation of N has the fewest adjacent digit changes, breaking ties by the largest base. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Income taxFor each income, subtract 0, 10 percent, or 20 percent tax depending on whether income is at most 1,000,000, at most 5,000,000, or larger. | Easy2 | ImplementationMath | No attempts yet | 2s | 512 MB | Judgeable |
| GradesGiven a list of grades, compare the midpoint of the maximum and minimum against the overall average, and report whether they differ by less than 1. | Easy2 | ArrayMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Counting Sheep (Large)For each N, find the first multiple of N that contains all ten digits, or report that no such multiple exists (only N = 0). | Easy2 | MathSimulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| MicrowaveGiven a start temperature below target, compute total heating time using per-degree rates for frozen and unfrozen states plus a fixed thawing time. | Easy2 | MathImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| One Hundred to TenParse a ratio written as n:m, divide both numbers by their greatest common divisor, and print the reduced ratio in the same format. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Base 9Convert a given decimal integer between 1 and 10000 into its base 9 representation. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Fibonacci-like SequenceGiven n up to 116, compute the n-th term of the recurrence f(n) = f(n-1) + f(n-3) with f(1)=f(2)=f(3)=1. | Easy2 | Dynamic programmingMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Speed LimitFor each log entry, multiply the speed by the time since the previous entry, sum these products, and print the total distance in miles. | Easy2 | ImplementationMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Linear EquationFor each linear equation ax + b = c, decide whether it has no, one, or infinitely many solutions and print the root truncated to six decimals. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Card Game ContestFor each of N games, Meiji has A_i decks, or gets one basic deck if A_i is 0. Count the number of distinct ways to enter, modulo M. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Perfect, deficient, or abundantFor each of T numbers below 10000, sum its proper divisors and classify it as Perfect, Deficient, or Abundant. | Easy2 | MathBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| 2017 Yonsei University Programming ContestCount triples (A, B, C) with A+B+C = N, all at least 1, C at least B+2, and A even. | Easy2 | Brute forceMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| EmpathyMultiply two binary numbers up to 30 bits long and print the product in binary without leading zeros. | Easy2 | MathString+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Recovering a Damaged ISBN DigitOne digit of a 13-digit ISBN is replaced by '*', and you print the digit that makes the weighted checksum divisible by 10. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| I am happy~Given the height N, width M, and a seat number K in row-major order, print the row and column of that seat. | Easy2 | MathImplementation+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Credit Card ValidationFor each 16-digit card number, apply the Luhn checksum (double every second digit from the right, sum digits) and print T if the total is divisible by 10, else F. | Easy2 | ImplementationString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Paint EstimateFor each floor plan, compute the paintable wall and ceiling area minus window and door areas, multiply by the number of apartments, and round the total up by the coverage of one can. | Easy2 | MathImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Bedtime Reading IGiven an integer I, compute the sum of all its divisors. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Term index in an arithmetic sequenceGiven a first term, a common difference, and a value k, print the 1-based position of k in the arithmetic sequence, or X if k is absent. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Sharing apples and bananasGiven a apples and b bananas, print every common divisor n of a and b with the per-friend apple and banana counts. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Base converterConvert a decimal integer m into base n (2 to 16), using A-F for digits 10 and above. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Building a distribution tableGiven real numbers in [0,1), count how many fall into each of m equal-length subintervals and print the counts in order. | Easy2 | ImplementationArray+1 | No attempts yet | 1s | 512 MB | Judgeable |
| The 3n+1 SequenceStarting from the given first term, apply the 3n+1 rule until the value first hits 1 and report that position. | Easy2 | SimulationMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Von Neumann and the FlyGiven train speed S, fly speed T, and initial gap D, compute how far the fly travels before the two trains collide. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Soccer SkillsAmong all teammates whose distance from you is between a and b, print the position, distance, and angle of the one with smallest x then smallest y. | Easy2 | ImplementationGeometry+1 | No attempts yet | 2s | 512 MB | Judgeable |
| I Work All DayGiven a list of saw settings and a tree height T, pick the setting H that minimizes T mod H, breaking ties by first appearance. | Easy2 | ImplementationBrute force+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Just A MinimGiven a list of note codes, sum their lengths in semibreves and print the exact value. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Coffee MachineGiven the number of employees on each of three floors, pick the floor for one coffee machine that minimizes total daily stair time. | Easy2 | Brute forceMath+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Happy TrailsGiven trail sections as angles and distances, compute the total elevation change and print it rounded to two decimals. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Arggggggh!Follow a start point and a series of compass moves to compute the final coordinates, rounded to 8 decimals. | Easy2 | ImplementationMath+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Life SavingsCompare the savings from one 20%-style whole-purchase coupon against the best way to spend two one-item coupons on two of three items, then print the winning plan and its savings. | Easy2 | Brute forceMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Batter UpRead n at-bat outcomes, sum the bases from official at-bats (0 to 4), divide by how many of them are not walks, and print the result to six decimals. | Easy2 | ImplementationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Congruent NumbersGiven the two legs of a right triangle as fractions p1/q1 and p2/q2, print 1 if the triangle's area is an integer, otherwise 0. | Easy2 | MathNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Boolean SatisfiabilityCount the assignments of a disjunction of single literals that make the formula true, where each variable takes true or false. | Easy2 | CombinatoricsMath+2 | No attempts yet | 3s | 512 MB | Judgeable |
| Incomplete BookGiven the first book takes k days and each later book takes twice the previous, count how many books finish by day d. | Easy2 | MathSimulation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Beautiful MusicFor each note sequence, check whether every consecutive pair is 2, 4, or 6 steps apart on the repeating 7-note scale, and print one of two messages. | Easy2 | ImplementationString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Sum Squared Digits FunctionFor each of P datasets, convert the given integer n to base b, square each digit, and report the total with the dataset number. | Easy2 | MathImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Santa's GiftsCompute the total straight-line distance from Santa's house through four given points in 3D and check it does not exceed the time limit X. | Easy2 | MathGeometry+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Big number A+BRead two integers with up to 10000 digits and print their sum without leading zeros. | Easy2 | StringMath+2 | No attempts yet | 1s | 256 MB | Judgeable |
| A Simple ProblemGiven N, print the smallest positive multiple of N squared, which is just N squared itself. | Easy2 | MathImplementation+1 | No attempts yet | 3s | 512 MB | Judgeable |
| Check the CheckRead dish names and price-quantity pairs until the line TOTAL, then print PAY if the waiter's total is at most the sum of price times quantity, else PROTEST. | Easy2 | ImplementationString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Shattered CakeGiven the cake's width and the dimensions of all shattered rectangular pieces, sum the piece areas and divide by the width to get the length. | Easy2 | MathImplementation+2 | No attempts yet | 10s | 512 MB | Judgeable |
| Triangles from Five SticksGiven five distinct stick lengths, count how many 3-stick subsets can form a triangle with positive area. | Easy2 | Brute forceGeometry+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Jaccard Similarity ThresholdGiven two small sets of digits, decide whether their Jaccard similarity is greater than 0.5. | Easy2 | ImplementationMath | No attempts yet | 1s | 512 MB | Judgeable |
| PencilsChoose either set X or set Y, buy any number of copies of that one set, and pay the least to reach at least N pencils. | Easy2 | MathImplementation | No attempts yet | 2s | 512 MB | Judgeable |
| Hash collision stringsPrint two length-N strings that differ but have equal Java String hashCode values, using the classic Aa/BB collision with a shared prefix. | Easy2 | StringHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Abbey CourtyardGiven the area of a square courtyard, compute the perimeter as 4 times the square root of the area, rounded to six decimal places. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Cube BitsConvert each of n decimal integers (up to 3^20) to its base-3 representation without leading zeros. | Easy2 | MathImplementation | No attempts yet | 4s | 512 MB | Judgeable |
| Sum of DivisorsGiven a natural number n up to 10000, print the sum of all its positive divisors, with 1 and n included. | Easy2 | MathBrute force | No attempts yet | 1s | 256 MB | Judgeable |