Curated sets

Math and counting

Number theory, combinatorics, and geometry.

All problems
Total results6,670 problems
TopicsJudge
Dividing the Chocolate BarTwo brothers split an a by b chocolate bar with one straight cut so the two pieces differ in area as little as possible.Easy2MathNo attempts yet1s128 MBJudgeable
Overlapping Rectangle AreaGiven two axis-aligned rectangles, compute the area of their overlapping region.Easy2GeometryNo attempts yet1s128 MBJudgeable
Little SnowmanChoose whether the fixed ball k is the bottom, middle, or top of a three-ball snowman with halved volumes to maximize total volume within x liters.Easy2MathBrute forceNo attempts yet1s128 MBJudgeable
Bouncing BallGiven drop height x and target w, find the smallest number of doublings that make x reach at least w.Easy2MathNo attempts yet1s512 MBJudgeable
Making Grid PaperPick the sheet that yields the most grid cells under the margin and spacing rules, breaking ties by area, and output its area.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
PaintsCompute the extra red, yellow, and blue paint to buy after splitting each mixed room amount evenly between its two base colors.Easy2MathNo attempts yet1s128 MBJudgeable
TournamentFor each test case with n contestants and group size k, count how many contestants can reach the final survivors under some grouping.Easy2MathNo attempts yet1s128 MBJudgeable
Missing DigitsEach cipher hides one digit as x in A or B, and you try digits 0 to 9 to find the smallest that makes A divisible by B.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Closing the CircuitShift every given upper pair forward by one position modulo n and print the sorted lower pairs after TAK.Easy2ImplementationSorting+1No attempts yet3s128 MBJudgeable
MondaysGiven year length N, week length M, and starting weekday L, count the days from 1 to N that fall on the first weekday.Easy2MathNo attempts yet1s128 MBJudgeable
Rock Paper ScissorsCompare the two players' winning chances from their move probabilities and print who is more likely to win each match.Easy2ProbabilityMath+1No attempts yet1s128 MBJudgeable
BookmakersDecide whether stakes on both match outcomes can guarantee a profit given decimal odds X and Y.Easy2MathNo attempts yet1s128 MBJudgeable
Power StripsGiven N cords and strips that add K outlets each, compute how many free outlets remain after connecting everything.Easy2MathNo attempts yet1s128 MBJudgeable
Changing a Light BulbCompute the sum 1 + 4 + ... + 4^(A-1) modulo 500000009 for the given level count A.Easy2MathNo attempts yet1s128 MBJudgeable
Old BillGiven N and middle digits XYZ, fill in the first and last digits of the five-digit total so N divides it, choosing the largest valid total.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
ClockFind the time with the median clock-hand angle among five given times, breaking angle ties by earlier time.Easy2MathSorting+1No attempts yet1s128 MBJudgeable
Mathematical CuriosityCount pairs 0<a<b<n where a squared plus b squared plus m is divisible by a times b.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Addition in Different BasesAdd two numbers of up to 1000 digits in bases 1 to 35, including unary base 1, and print each equation with its sum in the same base.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Air speed of a fully laden swallowYou group messy swallow flight records by subspecies and compute two average speeds for each group.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Sir Bedavere's Bogus DivisionPrint every three-digit fraction with numerator in L to R that keeps its value after erasing the shared digit.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Taunt Exposure EstimationRead CSV time measurements and estimate total exposure with the trapezoid rule, then print the range and integral with fixed rounding.Easy2ImplementationMathNo attempts yet1s128 MBJudgeable
Consecutive Digits in a Rational NumberReport the base-7 digits in positions f through l after the point for the fraction n over d.Easy2SimulationMathNo attempts yet1s128 MBJudgeable
Check DigitsRead numbers until a # line and print each with its mod-11 weighted check digit or Rejected.Easy2ImplementationMathNo attempts yet1s128 MBJudgeable
Reducing Improper FractionsRewrite each given fraction as a mixed number, omitting the zero integer or fractional part.Easy2MathNo attempts yet1s128 MBJudgeable
Geometric InflationSimulate the monthly price recurrence with half-up cent rounding and print the Nth month cost with comma grouping.Easy2SimulationMath+1No attempts yet1s128 MBJudgeable
Arithmetic and Geometric SumsGiven N and the first three terms of an arithmetic or geometric series, detect the type and output the sum of the first N terms for each data set.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Monitor DPICompute horizontal and vertical DPI from diagonal size and resolution with the 16:9 ratio for each line until 0 0 0.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Fast Food PrizesAdd up, over disjoint prize sets, the prize value times the smallest sticker count among its required kinds.Easy2GreedyMath+1No attempts yet2s128 MBJudgeable
Zombie InvasionProcess villages east to west, moving half of each village west and leaving at most one behind, with everything gathering on the west coast.Easy2SimulationMathNo attempts yet2s128 MBJudgeable
Von NeumannTwo trains approach each other while a fly shuttles between them, and the program prints how far the fly travels before they collide.Easy2MathNo attempts yet1s128 MBJudgeable
The n Days of ChristmasFor each n until 0, compute the total gifts when day k of n brings k gifts down to 1.Easy2MathImplementationNo attempts yet2s128 MBJudgeable
Long is a train, a train is fast, fast is a planeCompute the travel time gap between a slower train and a faster plane over M km and print each gap as rounded H:MM:SS.Easy2ImplementationMathNo attempts yet1s128 MBJudgeable
Perfect Number CheckDecide whether each given integer equals the sum of its proper divisors and print the equation or a negative verdict.Easy2Number theoryImplementationNo attempts yet2s128 MBJudgeable
Kids love candyEach test case gives candy piles and K, and asks for the most children who can each receive at least K pieces of a single kind.Easy2MathGreedyNo attempts yet1s128 MBJudgeable
Combination LockCount distinct triples of dial positions within circular distance 2 of either of two given combinations.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
VicinityFor each query, count how many of the n points lie within distance d_v of the chosen base point, excluding the base point itself.Easy2Brute forceGeometryNo attempts yet1s128 MBJudgeable
Stone Game 5Two players alternately take 1 or 3 stones from a pile of N, and the program prints SK or CY for optimal play.Easy2Game theoryMathNo attempts yet1s128 MBJudgeable
Anti-Arithmetic PermutationFor each permutation of 0 to n-1, decide whether any three terms in order form an arithmetic progression.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Fibonacci remainderFor each test case, compute the P-th Fibonacci number of the sequence starting 1, 1 modulo Q and print it as Case #x: M.Easy2MathSimulationNo attempts yet1s128 MBJudgeable
Qurban 2011Given buffalo part orders and sheep orders, round buffalo parts up by seven and pack the animals into trips of three buffaloes or six sheep.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
BeeThe program counts logged jobs under each of seven bee work codes and prints each count with its share of the total.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Extending Goldbach's ConjectureThe program reads each m and prints whether m consecutive odd integers sum to m cubed and the first one when they do.Easy2MathNo attempts yet1s128 MBJudgeable
The KingPick any subset of up to 100 values from minus 3 to 3 so the sum of the chosen values raised to the given power 1 to 3 is as large as possible.Easy2GreedyMathNo attempts yet2s128 MBJudgeable
Rectangle intersectionCompute the area shared by all n axis-aligned rectangles, or 0 when they do not all overlap.Easy2GeometryIntervalsNo attempts yet2s512 MBJudgeable
EuclidRead two positive integers up to 32767 and print their greatest common divisor.Easy2Number theoryNo attempts yet2s512 MBJudgeable
Zeros in a FactorialCount how many zero digits appear in the decimal representation of n factorial for a given n below 100.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
The Euclidean AlgorithmCount how many subtraction steps the original Euclidean algorithm needs to find the gcd of two integers up to 32767.Easy2SimulationMathNo attempts yet1s128 MBJudgeable
Centroid of Point MassesCompute the mass-weighted average x and y over each point set and print each centroid rounded to two decimals.Easy2MathImplementationNo attempts yet3s128 MBJudgeable
Polar ExplorerGiven planet radius, fuel, and the angle to the crash site, decide if the round trip on the shorter arc fits and report leftover fuel or reachable miles.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Microwave ButtonsPress the 5-minute, 1-minute, and 10-second buttons to total exactly T seconds with the fewest presses, or print -1 when impossible.Easy2GreedyMathNo attempts yet1s64 MBJudgeable
Focal Length of a LensGiven object and image distances for each test case, compute the lens focal length and print it rounded to one decimal place.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Aligned CalendarConvert each Gregorian date into the 13-month calendar with 28-day months and report the leftover days as holidays.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Tax Rate ChangedFind the pair of pre-tax prices that summed to s after x% tax and gives the largest total after y% tax.Easy2Brute forceMathNo attempts yet1s256 MBJudgeable
Dice GameEach player rolls two dice with consecutive face ranges and the larger total wins, so compute both win probabilities from the four ranges.Easy2ProbabilityBrute forceNo attempts yet1s256 MBJudgeable
Runway PlanningGiven each heading in degrees, compute the two-digit runway number by rounding and folding to the range 1 to 18.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Ice Bucket ChallengeFind the fewest ice-pouring participants needed to reach a donation goal when each pourer donates 10 and recruits K friends while skippers donate 100.Easy2MathNo attempts yet1s256 MBJudgeable
HeadshotAfter a click on a circular cylinder, compare firing at once against spinning first and print which choice is safer.Easy2ProbabilityStringNo attempts yet1s64 MBJudgeable
Radix 32 ConversionConvert each base-32 string of up to 8 digits to its decimal value and to binary by expanding every digit to 5 bits.Easy2MathStringNo attempts yet1s64 MBJudgeable
Growling GearsFor each gear compute the vertex value of -aR^2 + bR + c and output the gear with the largest maximum.Easy2MathNo attempts yet1s256 MBJudgeable
TriplesCount triples x<=y<=z<=m with x^j+y^j=z^j for each exponent j from 2 to n and print the total.Easy2Brute forceMathNo attempts yet5s256 MBJudgeable
Joy of FlightAdd up the wind drift over k seconds and, if the remaining distance fits the speed limit, print the evenly paced flight positions.Easy2ImplementationSimulation+1No attempts yet2s256 MBJudgeable
Professor Tardiness MaxFind the largest integer t with t plus t squared at most d for each given class length.Easy2MathNo attempts yet1s256 MBJudgeable
Hitting the TargetsCount, for each of up to 100 shot points, how many of up to 30 given rectangles and circles contain it, boundaries included.Easy2GeometryImplementationNo attempts yet2s256 MBJudgeable
Closest Web Color NameThe program maps each RGB triple to the closest of 16 named HTML colors by Euclidean distance, breaking ties by table order.Easy2Brute forceMathNo attempts yet2s256 MBJudgeable
Working HoursAdd signed hour and minute terms in a flexible format and print each total as H:MM.Easy2ImplementationString+1No attempts yet2s256 MBJudgeable
Canteen CheckoutChoose the number of fixed-price 4-item set menus that minimizes the total bill for the tray.Easy2Brute forceMathNo attempts yet1s64 MBJudgeable
Comma Separated SumAdd all the natural numbers listed in the comma-separated string S.Easy2StringMathNo attempts yet1s256 MBJudgeable
Four NumbersAdd the two numbers formed by writing B directly after A and D directly after C.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
BeltsGiven each belt rotation ratio and twist, compute the last wheel speed and direction when the first wheel turns clockwise once per minute.Easy2SimulationMathNo attempts yet1s256 MBJudgeable
International MeetingConvert a HH:MM meeting time from one UTC offset to N coworker offsets and print each local time of day.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Veni, vidi, viciDrop the last letter of each odd-length ciphertext, then decode every letter pair into one plain letter with the given key.Easy2StringMathNo attempts yet1s256 MBJudgeable
Best guess in the random gamePick the number from 1 to N whose interval of radius K covers the most hidden values and report its coverage count.Easy2MathIntervalsNo attempts yet1s256 MBJudgeable
Base Conversion 2Convert the decimal number N to base B, writing digits above 9 as uppercase letters.Easy2MathImplementationNo attempts yet0.5s256 MBJudgeable
Rocket height at last separationSimulate n rocket stages with the given thrust, mass, and burn time formulas and print the height when the last stage drops.Easy2SimulationMathNo attempts yet1s256 MBJudgeable
Three Kangaroos 2Three kangaroos on integer points let an outer one jump between the other two, and each test case asks for the largest possible number of jumps.Easy2GreedyMathNo attempts yet1s256 MBJudgeable
Binomial Coefficient 1Compute the binomial coefficient N choose K for given N up to 10 and K between 0 and N.Easy2CombinatoricsMathNo attempts yet1s256 MBJudgeable
Pythagorean ExpectationAdd up each team's scored and allowed runs from the match records, apply the given formula, and print the largest and smallest values scaled by 1000.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
The Traveling OrienteererGiven point coordinates and lists of courses, compute each course total Euclidean length rounded to the nearest integer.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Decode the MessageThe program decodes each word into one character from its letter values modulo 27.Easy2StringMath+1No attempts yet1s256 MBJudgeable
Counting zerosCount how many times the digit 0 appears when writing every integer from N to M.Easy2Brute forceMathNo attempts yet3s256 MBJudgeable
ElectionFor each test case, count how many coins overlap each coin and print the top name or TIE on ties.Easy2GeometryBrute force+1No attempts yet1s256 MBJudgeable
Reverse the Binary DigitsRead N, write it in binary without leading zeros, reverse the digits, and print the reversed string as a decimal number.Easy2Bit manipulationMathNo attempts yet1s256 MBJudgeable
Choosing an Exam SetYou compare exam sets by random-guess expected score and pick the highest, preferring fewer questions then the smaller number.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
Minions' MasterFor each town, compute the average power and the percentage of residents above it, rounded to three decimals.Easy2ImplementationMathNo attempts yet3s256 MBJudgeable
Hangul 2Given one Hangul syllable, compute its one-based index in the ordered list of 11172 syllables.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Initial, Medial, FinalDecompose one Hangul syllable into its initial, medial, and optional final jamo and print each on its own line.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Compose a Hangul SyllableJoin the given choseong, jungseong, and optional jongseong into a single Hangul syllable and print it.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
Margaret's Minute Minute ManipulationDecode two binary-clock matrices into times, add them modulo 24 hours, and print the sum in the same matrix format.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
Creature Number SystemsConvert each given decimal number up to 5000 into the creature's base between 2 and 20, using letters A to J for digits above 9.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
PriceApply the sticker discount and then the optional coupon to each price, round to cents, and apply the extra cash rounding for cash payments.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
CypherDecrypt each message line by shifting its lowercase letters back by the Caesar shift computed from its date.Easy2StringMathNo attempts yet1s256 MBJudgeable
Time Limit CheckFor each case, evaluate f(N) times T from the named complexity and print TLE when it exceeds 10^8 times L.Easy2MathImplementationNo attempts yet2s256 MBJudgeable
Minimum Final Exam ScoreGiven project, paper, and midterm scores, compute the smallest integer final score from 0 to 100 that lifts the weighted grade to 90, or report impossible.Easy2MathNo attempts yet1s256 MBJudgeable
The Big Eye in the SkyFor each point in the first quadrant, print its angle from the positive x-axis in degrees, rounded to the nearest integer.Easy2MathGeometryNo attempts yet1s256 MBJudgeable
DistributionYou split the integers from 0 to 2^N - 1 into 2^K boxes of equal size with equal total popcount by pairing each x with its bitwise complement.Easy2Bit manipulationMath+1No attempts yet1s512 MBJudgeable
Mr. Gorbachev, Tear Down This Wall!Add up the lengths of the axis-aligned wall segments and report the total work hours split across the workers, rounded up.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Three Origami SquaresCut three equal axis-aligned squares from an h by w sheet and print the largest possible side length.Easy2GeometryMathNo attempts yet2s256 MBJudgeable
Distribution in MetagoniaRepeatedly peel off 2^a times the largest power of 3 fitting the odd part of the remainder until it hits zero, then print the pieces sorted.Easy2SimulationMath+1No attempts yet2s256 MBJudgeable
Mountain BikingFor each segment top, starting from rest, accumulate slope acceleration to compute the arrival speed at the foot.Easy2MathSimulationNo attempts yet1s256 MBJudgeable
Jump King Choi JunminStarting from 0 with jumps of exactly k in either direction, count how many integers from a to b are multiples of k.Easy2MathNo attempts yet1s256 MBJudgeable