Curated sets
Math and counting
Number theory, combinatorics, and geometry.
Total results6,670 problems
| Topics | Judge | |||||
|---|---|---|---|---|---|---|
| Find MultiplesRead n, then read numbers until a sentinel 0, printing for each whether it is a multiple of n. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Number Card GameFor each starting number S, repeatedly replace it with the product of its digits until a single digit appears, printing every value in order. | Easy2 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Pizza PricingFor each menu of pizzas, find the diameter of the pizza with the lowest cost per square inch. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| QuicksumCompute a weighted checksum for each input line: sum each character's 1-based position times its letter value, where spaces count as 0, until a line with only #. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| St. IvesFor each floating-point n until a terminating 0, print 1 + n + n^2 + n^3 + n^4 rounded to two decimals. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fifty Coats of GrayGiven room dimensions, opening sizes, and the area one can covers, compute the total paintable area for n apartments and round up to whole cans. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Roaming RomansConvert each English-mile distance into Roman miles and paces using a fixed ratio, rounding the pace count to the nearest integer. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Twin ParadoxGiven Earth time and spaceship time, compute the ship's average speed as a fraction of light speed and print it to three decimals. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parlay WageringSimulate a sequence of parlay wagers: apply each money-line multiplier with truncation, skip ties, and format the final payout with commas. | Easy2 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| General Chemistry LabGiven a sequence of temperatures ending with 999, print each temperature's difference from the previous one, rounded to two decimals. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Financial ManagementGiven twelve monthly closing balances, compute the mean and print it rounded to the nearest penny with a dollar sign. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Tire DimensionsParse a tire size code and compute its overall circumference from the section width, aspect ratio, and rim diameter. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Next NumberGiven three distinct integers from an arithmetic or geometric progression, decide which type it is and print the label with the next term. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| FIFA World CupGiven groups, teams per group, advancers per group, and byes, compute total matches played plus teams padded to the next power of two. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Number Guessing GameFor each n0, report whether 3*n0 is odd or even and print n4, the quotient of (n2*3)/9. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Judging OlympiaFor each line of six judge grades, discard the highest and lowest and print the average of the remaining four, stopping at the all-zero line. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Being Smarty!Given row R and block size N, decide whether the alternating style property P1 or P2 applies to that row. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Euclidean ClockGiven two clock times and a radius, find the area of the sector swept by the hour hand between them. | Easy2 | MathGeometry+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ICPC Score Totalizer SoftwareFor each contestant, drop one highest and one lowest judge score, then output the truncated average of the rest. | Easy2 | ImplementationSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SavingsFor each test case, print how many years of multiplying the balance by (1 + B/100) are needed until it first exceeds M. | Easy2 | SimulationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Jean and Joe's ClothesRead clothing sizes and count how many items go to Joe, Jean, Jane, James, or no one, per visit until N equals 0. | Easy2 | ImplementationSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| RecipesMultiply each recipe amount by a constant and print the result as a reduced integer or mixed fraction. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Map InterfaceGiven station coordinates and a visited sequence, count how many stations fall inside the smallest axis-aligned rectangle covering the visited stations. | Easy2 | ArrayImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bailout BonusGiven a list of bailed-out companies, a tax rate, and executives with company and bonus, sum the floor of the taxed fraction for executives at bailed companies. | Easy2 | ImplementationHash map+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Isn't It Funny How a Bear Likes Honey?Given Pooh's weight and the radii of several spherical helium balloons, decide whether their combined lift strictly exceeds his weight. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Civil EngineeringRead material densities and oblong dimensions, then sum each oblong's volume times its material density for each data set. | Easy2 | ImplementationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Aerospace & Mechanical EngineeringGiven each stage's mass, burn time, and thrust, simulate the rocket's vertical motion and report its height when the last stage falls off. | Easy2 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Alphabet DistanceFor each test case, read two equal-length uppercase words and print the alphabet distance between the paired letters at every position. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Vigenère CipherEncrypt each given plaintext with the Vigenère cipher, shifting every letter by the aligned repeated keyword letter modulo 26. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Stacked Floating MountainsGiven several sequences, decide for each whether every element from the third onward equals the sum of the two before it. | Easy2 | ImplementationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting Swann's CoinsPrint numbers 1 through N, replacing multiples of 3 with Dead, of 5 with Man, and of 15 with DeadMan, breaking the line after each word. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Fill the Rowboats!Print the numbers 1 through N, inserting the word Go! after every sixth number and after the last one. | Easy2 | ImplementationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Greatest Common DivisorRead n pairs of positive integers and print the greatest common divisor of each pair on its own line. | Easy2 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Least Common MultipleFor each of n test cases, read two natural numbers a and b and print their least common multiple. | Easy2 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Mars MathEvaluate a chain of at most three Mars operations (@, %, #) on a starting number and print the result to two decimals. | Easy2 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Escape RouteGiven your position and n-1 planet positions, find the closest planet, print both coordinates, and print the distance rounded to two decimals. | Easy2 | Brute forceMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Annoying MosquitosGiven up to 100 mosquito positions and up to 10000 swat centers, count how many mosquitos fall within the 101x101 square of at least one swat. | Easy2 | Brute forceImplementation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Vacation HomeworkGiven L vacation days and per-day limits C and D, find the most free days after finishing A Korean and B math pages. | Easy2 | MathGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Time CardGiven clock-in and clock-out times for three employees in h m s form, print each employee's working duration as hours, minutes, and seconds. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ChangeGiven a purchase amount below 1000 yen paid with a 1000-yen bill, find the minimum number of coins in the change. | Easy2 | GreedyMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Caesar CipherGiven an uppercase word encrypted by shifting each letter forward three positions, shift every letter back by three to recover the original. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangle Validity and ClassificationRead lines of three side lengths, count valid triangles as right, acute, or obtuse, and stop at the first line that is not a triangle. | Easy2 | ImplementationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Hailstone SequencesFor each starting value H up to 500, simulate the Collatz rule and print the largest number that appears before reaching 1. | Easy2 | SimulationImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Factorial BaseRead each factorial-base number, weight digit at position i (from the right, 1-indexed) by i!, and print the decimal value. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Jingle ComposingSplit a slash-delimited composition into measures and count how many note durations sum exactly to 1. | Easy2 | StringImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FeynmanFor each N, count all axis-aligned squares contained in an N by N grid of unit cells, ending at the sentinel 0. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Contest TimingShe starts at 11:11 on 11/11. Given the day, hour, and minute she stops, print the minutes elapsed, or -1 if the stop is earlier. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Math PracticeGiven A (0 to 45) and B (1 to 9), find the smallest E in 1 to 62 with E > A and 2^E starting with digit B, or 0 if none exists. | Easy2 | MathBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Odd or EvenRead N large integers up to 10^60 and print odd or even for each, judging parity from the last digit. | Easy2 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Scavenger HuntList every pair (x, y) where x divides P and y divides Q, sorted by x then y. | Easy2 | MathBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| StatisticsRead N integers, print their mean and median rounded to six decimal places. | Easy2 | ArraySorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Color Me LessRead 16 target RGB colors, then map each following color to the nearest target color by Euclidean distance, breaking ties by earliest appearance. | Easy2 | ImplementationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Approximating ePrint approximations of e for n from 0 to 9, each rounded to 9 decimals with trailing zeros removed, under a fixed two-line header. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Getting ChordedGiven three note names, decide whether their semitone spacing forms a major or minor chord, then print the echo with the root-named chord or "unrecognized". | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| GolfFor each test case, turn a hole's par and John's stroke count into the standard golf score name, with hole-in-one taking priority. | Easy2 | ImplementationMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| PerfectionFor each number below 60000, sum its proper divisors and classify it as perfect, deficient, or abundant. | Easy2 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Ballot EvaluationSum the given parties' vote percentages and check the sum against an integer n using the guess's comparison operator. | Easy2 | Hash mapImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hard to Believe, but True!Read the numbers in each equation backwards, add them, and check whether the sum equals the backwards-read result. | Easy2 | StringMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Next in LineGiven the ages of the youngest and middle of three children in an arithmetic sequence, print the oldest child's age. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Speed fines are not fine!Given a speed limit and a recorded speed, decide whether the car is speeding and print the matching fine from a three-tier table. | Easy2 | ImplementationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Big Bang SecretsDecode an uppercase word by shifting each letter backward by S = 3P + K positions, where P is the letter's 1-based position. | Easy2 | ImplementationString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Sumac SequencesStarting from two integers, repeatedly replace the pair with (second, first minus second) until the difference turns negative and report how many terms appear. | Easy2 | SimulationMath | No attempts yet | 2s | 512 MB | Judgeable |
| UnfriendCount the subsets of nodes in a rooted tree that can be removed, where removing a node forces removal of all its descendants. | Easy2 | TreeBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| What is n, Daddy?Count the ordered pairs (a, b) with 1 <= b <= a <= 5 and possibly a single hand, summing to n. | Easy2 | MathBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| ISBN 1-3-SumGiven the last three digits of an ISBN starting with 9780921418, compute the 1-3-sum and print it. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Good TimesGiven the time in Ottawa as hour*100+minute, print the local time in seven Canadian cities using fixed offsets, wrapping across midnight. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Body Mass IndexRead a weight and a height, compute weight divided by height squared, and print the BMI category. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Deal or No Deal CalculatorRead eliminated case numbers and a Banker's offer, compute the average of the remaining amounts, and print deal if the offer is higher, otherwise no deal. | Easy2 | ImplementationArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Federal Voting AgeFor each birth date, decide whether the person is at least 18 years old on February 27, 2007. | Easy2 | ImplementationMath | No attempts yet | 1s | 128 MB | Judgeable |
| The Cell SellGiven daytime, evening, and weekend minutes, compute the monthly cost under two phone plans and print the cheaper one. | Easy2 | ImplementationMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Mouse MoveThe cursor starts at (0,0) on a screen of width c and height r; each relative move is clamped to the screen edges, and the position after every move must be printed. | Easy2 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SquaresGiven a number of tiles, find the largest integer side length whose square does not exceed that number. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Terms of OfficePrint every year from X to Y in which all four offices change, which happens on multiples of lcm(4,2,3,5) = 60, formatted as a fixed sentence. | Easy2 | MathImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Constrained PermutationsCount permutations of 1..n (n at most 9) that satisfy given ordering constraints x before y. | Easy2 | Brute forceCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fraction ActionReduce a numerator and denominator to simplest form, then print it as a whole number, a proper fraction, or a mixed number. | Easy2 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Mod InverseGiven x and m, find n with 0 < n < m such that x*n mod m equals 1, or report that none exists. | Easy2 | Number theoryBrute force | No attempts yet | 1s | 128 MB | Judgeable |
| CalendarGiven the weekday of the 1st and the number of days, print a month calendar in a fixed weekly layout with right-aligned columns. | Easy2 | ImplementationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cross-Number PuzzlePrint all perfect numbers from 1000 to 9999, then all three-digit numbers equal to the sum of their digits' cubes. | Easy2 | Brute forceMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| NumbersGiven three distinct digits and one of their six permutations, find that number's 1-based rank when all six permutations are sorted ascending. | Easy2 | MathSorting+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Building BlocksGiven a target height N and three block heights, pick the kind whose multiples get closest to N, breaking ties by smaller block then shorter tower. | Easy2 | MathBrute force | No attempts yet | 1s | 1024 MB | Judgeable |
| EntropyRead one line of text, count how often each character appears, and print the Shannon entropy rounded to three decimals. | Easy2 | Hash mapMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ExpressionGiven N, build a fully parenthesized NAND (Sheffer stroke) expression for the carry-out bit by iterating a fixed string concatenation rule. | Easy2 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Right Triangle CheckFor each of n triples of side lengths, decide whether the triangle is right by checking if the largest side squared equals the sum of the other two squared. | Easy2 | MathGeometry+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GaussFor each test case, compute the sum of all integers from n to m inclusive and print the test case number followed by the sum. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| StuPIdGiven an ID with one unknown digit, use the checksum rule to find the missing digit and print the corrected ID. | Easy2 | MathImplementation+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Sexagenary Cycle (干支)Given a year, print its sexagenary cycle name as a branch letter A-L followed by a stem digit 0-9. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| CuboidsFor each cuboid row with one of the four values zeroed out, compute and print the missing length, width, height, or volume. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| DivisibilityGiven a base-62 string, decide whether the number it represents is divisible by 61. | Easy2 | MathNumber theory+1 | No attempts yet | 1s | 128 MB | Judgeable |
| TeleprimeGiven a six-digit number and a digit to prepend, print Yes if both the original and the resulting seven-digit number are prime. | Easy2 | Number theoryMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ConcertRead 10 RGB triples per data set, average each channel, and print the average rounded to the nearest integer. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Ways to Make RectanglesCount the number of unordered pairs (a, b) with a <= b and a*b <= n. | Easy2 | MathBrute force+1 | No attempts yet | 1s | 256 MB | Judgeable |
| PolynomialGiven a polynomial's coefficients and an integer x, print the last three digits of |W(x)|, padded with leading zeros. | Easy2 | MathImplementation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| KamilGiven a word Kamil spoke, count the words he could have meant, since each position may map to one of several letters. | Easy2 | MathCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| JulkaGiven the total apples and how many more Klaudia has, compute each girl's count. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Units Digit of a Power of TwoThe task is to print the units digit of 2 to the power n for a huge n. | Easy2 | MathImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Caesar CipherDecode a Caesar-shifted uppercase message by matching its most frequent letter to the given original letter. | Easy2 | StringArray+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Non-DivisorsGiven n, print the smallest and the largest integers from 1 to n that do not divide n. | Easy2 | Number theoryMath | No attempts yet | 1s | 128 MB | Judgeable |
| Sums and DifferencesCount ordered pairs from distinct positions where the difference exceeds the sum, which holds exactly when the second element is negative. | Easy2 | MathCombinatorics | No attempts yet | 1s | 128 MB | Judgeable |
| Step on the FootKozik and Adrian alternately shorten the gap by their foot lengths, and the first player facing a gap shorter than his foot wins. | Easy2 | Math | No attempts yet | 1s | 128 MB | Judgeable |
| KwadratDecide whether four given points are the vertices of a non-degenerate square with sides parallel to the axes. | Easy2 | GeometryImplementation | No attempts yet | 1s | 128 MB | Judgeable |