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 results2,619 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
The Good and the BadCount the letters g and b in each hero name, ignoring case, and print whether the name is GOOD, A BADDY, or NEUTRAL.Easy1StringImplementation+1No attempts yet1s128 MBJudgeable
No BrainerFor each zombie, compare the number of brains it eats X with the number it needs Y, and print whether X is at least Y.Easy1ImplementationBrute forceNo attempts yet1s128 MBJudgeable
Pair SumThis is a straightforward simulation task where numbers in each test case are used to enumerate pairs. For each input n, all pairs of distinct natural numbers with sum n are printed in lexicographic order. Because n is at most 12, iterating all possible a and b values directly works. Implemented with simple loops, this problem is a typical warm-up exercise.Easy1SimulationBrute force+1No attempts yet1s128 MBJudgeable
PyramidsFor each positive base size n until a terminating 0, print the total number of blocks in a pyramid whose layers count down from n to 1.Easy1MathImplementation+2No attempts yet1s128 MBJudgeable
Battle Droid PriceFor each test case, multiply five part quantities by fixed prices, sum them, and print the total with a dollar sign and two decimals.Easy1MathImplementation+2No attempts yet1s128 MBJudgeable
SanggeunaldGiven prices for three burgers and two drinks, print the lowest cost of one burger plus one drink minus a 50 won combo discount.Easy1ImplementationMath+2No attempts yet1s128 MBJudgeable
JOI and IOICount how many length-3 windows of a string equal JOI and how many equal IOI, including overlaps.Easy1StringBrute force+1No attempts yet1s128 MBJudgeable
Which Alien?Given the number of antennae and eyes a witness saw, print the names of all alien species whose ranges match, in the order given.Easy1ImplementationBrute force+1No attempts yet2s512 MBJudgeable
Roll the DiceCount ordered pairs (a, b) with a from 1 to m, b from 1 to n, and a + b = 10, then print the count with singular or plural wording.Easy1MathImplementation+1No attempts yet1s128 MBJudgeable
A graph that times out coloring backtrackingPrint one fixed graph: a 55-vertex clique joined by a path, chosen to make a backtracking coloring solver time out.Easy1GraphImplementation+1No attempts yet1s128 MBJudgeable
AlienGiven a point and n axis-aligned rectangles, decide whether any rectangle contains the point, boundaries included.Easy1GeometryImplementation+2No attempts yet2s128 MBJudgeable
Grocery ShoppingPick the crab stick bag with the highest grams per won, breaking ties by the lowest price.Easy1Brute forceMathNo attempts yet1s128 MBJudgeable
Zero or OneGiven three bits picked by three players, print the player whose bit differs from the other two, or * if there is no such player.Easy1ImplementationBrute forceNo attempts yet1s512 MBJudgeable
A toast that wins over the roomGiven one of eight fixed Hangul abbreviations joined by periods, print the full Korean toast phrase it stands for.Easy1ImplementationString+1No attempts yet2s512 MBJudgeable
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.Easy1ImplementationMath+1No attempts yet2s512 MBJudgeable
Polynomial Derivative (Small)Given the nonzero terms of a polynomial, compute the value of its derivative at x = 1.Easy1MathImplementation+1No attempts yet1s128 MBJudgeable
FizzBuzzPrint the numbers 1 through N, writing Fizz for multiples of X, Buzz for multiples of Y, and FizzBuzz for multiples of both.Easy1ImplementationMath+2No attempts yet1s512 MBJudgeable
Sim CardFor each student, compute the smallest total cost of call minutes and data across the three fixed operator price plans.Easy1ImplementationBrute force+1No attempts yet2s512 MBJudgeable
Linear Algebra and GroupOutput the sum of the digits appearing in the cover illustration of a specific linear algebra textbook.Easy1ImplementationMath+2No attempts yet1s256 MBJudgeable
YeeRead any amount of input, including none, and print the single word Yee.Easy1ImplementationBrute forceNo attempts yet2s512 MBJudgeable
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.Easy1ArrayImplementation+2No attempts yet1s512 MBJudgeable
Overflowing with SweetnessGiven triples a and c, find triple b with components in 1 to 100 such that performing the defined cake operation a cake b yields c.Easy1MathImplementation+2No attempts yet1s256 MBJudgeable
Born in 1998, but 2541 in Thailand?!Given a Buddhist calendar year between 1000 and 3000, print the corresponding Gregorian year by subtracting 543.Easy1MathImplementation+2No attempts yet1s1024 MBJudgeable
RatsGiven three counts from a mark-recapture study, compute the Chapman estimator using the stated floor formula and print it.Easy1MathImplementation+1No attempts yet1s512 MBJudgeable
Extreme TemperaturesRead lines that pair a date with integer temperatures and print the smallest and largest values across every measurement.Easy1ImplementationArray+2No attempts yet2s512 MBJudgeable
The Walking AdamGiven a string of 'U' and 'D' steps, find the index of the first 'D', or the string length if no 'D' appears.Easy1StringImplementation+1No attempts yet2s512 MBJudgeable
Random Game~~~~~Output any integer between 1 and 2,147,483,647; the judge scores each of three runs by how close your number lands to a hidden random pick.Easy1MathProbability+2No attempts yet1s256 MBJudgeable
Hansu NumbersCount integers from 1 to N (N up to 1000) whose digits form an arithmetic sequence.Easy2ImplementationBrute force+1No attempts yet2s128 MBJudgeable
Make It DivisibleFind the smallest two-digit replacement (00-99) for the last two digits of N that makes N divisible by F.Easy2Brute forceMath+1No attempts yet2s128 MBJudgeable
Splitting a WordSplit a lowercase word into three nonempty parts, reverse each part, and find the lexicographically smallest concatenation among all splits.Easy2StringBrute force+1No attempts yet2s128 MBJudgeable
Choosing a Team NameCount letters L,O,V,E across a fixed name plus each candidate string, compute a formula mod 100, and print the candidate with the highest value, breaking ties by lexicographic order.Easy2StringImplementation+1No attempts yet2s128 MBJudgeable
Yujin NumberGiven an integer up to about 2.1 billion, determine whether some split of its digits into a left and right part yields equal digit products.Easy2StringBrute force+1No attempts yet2s128 MBJudgeable
Time MachineGiven three two-digit numbers from a digital clock, count how many of the 6 permutations form a valid HH:MM:SS time.Easy2CombinatoricsBrute force+1No attempts yet2s128 MBJudgeable
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.Easy2MathBrute force+1No attempts yet2s128 MBJudgeable
Counting PrimesCount how many of up to 100 given numbers (each at most 1000) are prime.Easy2MathBrute forceNo attempts yet2s128 MBJudgeable
Restoring NumbersFor each given integer up to 100,000, output its prime factorization as prime-exponent pairs in increasing order.Easy2MathNumber theory+1No attempts yet2s128 MBJudgeable
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.Easy2MathBrute forceNo attempts yet1s128 MBJudgeable
Super MarioGiven 10 mushroom scores, pick a prefix sum closest to 100 (preferring the larger one on ties) as Mario's final score.Easy2ArrayBrute force+1No attempts yet1s128 MBJudgeable
Maximum Value of a Fraction TableGiven a 2x2 grid of positive integers, find how many 90-degree clockwise rotations (0-3) maximize A/C+B/D, choosing the smallest such count on ties.Easy2Brute forceImplementation+1No attempts yet1s128 MBJudgeable
Snow White and the Seven DwarfsGiven nine distinct numbers, find and print in increasing order the seven of them that sum to exactly 100.Easy2Brute forceArrayNo attempts yet1s128 MBJudgeable
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.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Explicit FormulaGiven 10 binary inputs, evaluate a fixed XOR-of-ORs boolean formula (equivalently just count pairs/triplets with at least one 1 and check parity) and output the result.Easy2Bit manipulationImplementation+1No attempts yet3s256 MBJudgeable
Prerequisites?Given Freddie's chosen courses and category minimums, check whether each category has at least the required number of his courses.Easy2ImplementationHash map+2No attempts yet1s128 MBJudgeable
AFC WimbledonGiven the sum and difference of two non-negative scores, print the larger score first, or -1 if no such scores exist.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Find MultiplesRead n, then read numbers until a sentinel 0, printing for each whether it is a multiple of n.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Refrigerator MagnetsRead lines until END and print each line that contains no repeated letter, ignoring spaces.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
Gnome SequencingFor each of N triples of beard lengths, decide whether the three values are strictly increasing or strictly decreasing, then print Ordered or Unordered.Easy2ImplementationSorting+2No attempts yet1s128 MBJudgeable
St. IvesFor each floating-point n until a terminating 0, print 1 + n + n^2 + n^3 + n^4 rounded to two decimals.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Roaming RomansConvert each English-mile distance into Roman miles and paces using a fixed ratio, rounding the pace count to the nearest integer.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
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.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Filling Out the TeamFor each player's speed, weight, and strength, print the positions whose limits the player satisfies, in table order, or No positions.Easy2ImplementationBrute force+1No attempts yet1s128 MBJudgeable
Next NumberGiven three distinct integers from an arithmetic or geometric progression, decide which type it is and print the label with the next term.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
SavingsFor each test case, print how many years of multiplying the balance by (1 + B/100) are needed until it first exceeds M.Easy2SimulationMath+2No attempts yet1s128 MBJudgeable
Death Knight HeroCount how many of the given ability strings avoid the forbidden substring "CD".Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
National Collegiate Programming Contest Club FederationGiven hotels with per-person prices and weekly capacities, find the cheapest hotel and week that fit all N members within budget B.Easy2Brute forceImplementationNo attempts yet1s128 MBJudgeable
Card CuttingRead each game line of card values up to '*', count odd values for Cheryl and even values for Tania, and print the winner or Draw.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Map InterfaceGiven station coordinates and a visited sequence, count how many stations fall inside the smallest axis-aligned rectangle covering the visited stations.Easy2ArrayImplementation+2No attempts yet1s128 MBJudgeable
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.Easy2ImplementationHash map+2No attempts yet1s128 MBJudgeable
Civil EngineeringRead material densities and oblong dimensions, then sum each oblong's volume times its material density for each data set.Easy2ImplementationMath+2No attempts yet1s128 MBJudgeable
Chess PuzzleFor each board, read the rook coordinates and report SAFE if no two rooks share a row or column, otherwise NOT SAFE.Easy2ImplementationHash map+2No attempts yet1s128 MBJudgeable
Escape RouteGiven your position and n-1 planet positions, find the closest planet, print both coordinates, and print the distance rounded to two decimals.Easy2Brute forceMath+1No attempts yet1s128 MBJudgeable
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.Easy2Brute forceImplementation+1No attempts yet1s256 MBJudgeable
Factorial BaseRead each factorial-base number, weight digit at position i (from the right, 1-indexed) by i!, and print the decimal value.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Head or TailFor each test case, count the zeros and ones in the list of game results and print how many games Mary and John each won.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Pascal LibraryGiven D attendance rows over N alumni, decide whether some alumnus attended every dinner.Easy2ArrayImplementation+1No attempts yet1s128 MBJudgeable
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.Easy2MathBrute force+1No attempts yet1s128 MBJudgeable
Odd or EvenRead N large integers up to 10^60 and print odd or even for each, judging parity from the last digit.Easy2StringMath+2No attempts yet1s128 MBJudgeable
Barn EchoesGiven two lowercase strings, find the length of the longest string that is a prefix of one and a suffix of the other.Easy2StringBrute force+2No attempts yet1s128 MBJudgeable
Scavenger HuntList every pair (x, y) where x divides P and y divides Q, sorted by x then y.Easy2MathBrute force+1No attempts yet1s128 MBJudgeable
IBM Minus OneFor each of n uppercase names, shift every letter to the next letter of the alphabet, wrapping Z to A, and print the result with numbered headers.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
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.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
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.Easy2ImplementationMath+2No attempts yet1s128 MBJudgeable
PerfectionFor each number below 60000, sum its proper divisors and classify it as perfect, deficient, or abundant.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
Deli DeliFor each of N words, apply the first matching pluralization rule from a list of irregular forms and four suffix rules, then print the result.Easy2StringHash map+2No attempts yet1s128 MBJudgeable
Rotating LettersGiven a single uppercase word, decide whether every letter belongs to the set of seven letters that look the same after a 180-degree rotation.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
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.Easy2ImplementationMath+2No attempts yet2s512 MBJudgeable
UnfriendCount the subsets of nodes in a rooted tree that can be removed, where removing a node forces removal of all its descendants.Easy2TreeBrute force+1No attempts yet2s512 MBJudgeable
What is n, Daddy?Count the ordered pairs (a, b) with 1 <= b <= a <= 5 and possibly a single hand, summing to n.Easy2MathBrute force+2No attempts yet2s512 MBJudgeable
Old Fishing HoleGiven three point values and a cap, enumerate every catch with at least one fish whose total points stay within the limit, in a specified order.Easy2Brute forceSimulation+1No attempts yet1s128 MBJudgeable
It's Cold Here!Read city names with integer temperatures, one per line, and print the name of the city with the lowest temperature.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
SquaresGiven a number of tiles, find the largest integer side length whose square does not exceed that number.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Smile with SimilesGiven up to five adjectives and five nouns, print every phrase of the form "<adjective> as <noun>" in nested input order.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
TridentPrint an ASCII trident with t tine rows, a crossbar, and h handle rows, using spacing s between the tines.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
Constrained PermutationsCount permutations of 1..n (n at most 9) that satisfy given ordering constraints x before y.Easy2Brute forceCombinatorics+2No attempts yet1s128 MBJudgeable
AmeriCanadianRead words one per line until the line quit!, and for each word rewrite a trailing consonant followed by or as our when the word has at least five letters.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Mod InverseGiven x and m, find n with 0 < n < m such that x*n mod m equals 1, or report that none exists.Easy2Number theoryBrute forceNo attempts yet1s128 MBJudgeable
Cross-Number PuzzlePrint all perfect numbers from 1000 to 9999, then all three-digit numbers equal to the sum of their digits' cubes.Easy2Brute forceMath+1No attempts yet1s128 MBJudgeable
Making test data 8Print a specific fixed graph: 98 vertices, 1501 edges forming a complete bipartite graph, using the exact listed edge order.Easy2GraphImplementation+2No attempts yet1s128 MBJudgeable
Hidden Roman NumeralsFind which of the twelve Roman numerals from 1 to 12 appear as substrings of a given string over {I,V,X}.Easy2StringImplementation+1No attempts yet1s1024 MBJudgeable
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.Easy2MathBrute forceNo attempts yet1s1024 MBJudgeable
CardsA 52-card deck is missing exactly one card; given the other 51 cards as suit and value pairs, output the missing suit and value.Easy2ArrayHash map+2No attempts yet1s1024 MBJudgeable
Counting SheepCount how many words in each list match the string "sheep" exactly, case-sensitive, and print the count per list with blank lines between cases.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
StuPIdGiven an ID with one unknown digit, use the checksum rule to find the missing digit and print the corrected ID.Easy2MathImplementation+1No attempts yet3s128 MBJudgeable
TeleprimeGiven a six-digit number and a digit to prepend, print Yes if both the original and the resulting seven-digit number are prime.Easy2Number theoryMath+2No attempts yet1s128 MBJudgeable
Ways to Make RectanglesCount the number of unordered pairs (a, b) with a <= b and a*b <= n.Easy2MathBrute force+1No attempts yet1s256 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
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
Shoe FactoryChoose the price p from 1 to N that maximizes the count of buyers willing to pay p times the margin p minus K.Easy2Prefix sumBrute forceNo attempts yet1s128 MBJudgeable
SalesFor each test case, count pairs of days where the earlier day sold no more than the later day and print the total.Easy2Brute forceArrayNo 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