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 results14,366 problems
TopicsJudge
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
Travelling SalesmanCount the distinct town names in each week's list and report the total for that week.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
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.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
DVDsApply a series of clamped sale and restock transactions to each DVD title's stock and report the final count.Easy2ImplementationSimulation+2No attempts yet1s128 MBJudgeable
NoMoPhobiaFor each week, sum de-merit points for each student from misdemeanor codes and list those reaching 100, in first-appearance order.Easy2Hash mapImplementationNo attempts yet1s128 MBJudgeable
RecipesMultiply each recipe amount by a constant and print the result as a reduced integer or mixed fraction.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Oil ExplorationFor each column of a grid, scan downward and sum drilling costs (H costs 3, S costs 1) until the first oil cell, or print N if none exists.Easy2ArraySimulation+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
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.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Contest SeatsCount how many participants fail to get their chosen seat, since only the first arrival for a seat can sit there.Easy2ImplementationHash map+1No 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
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.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
Alphabet DistanceFor each test case, read two equal-length uppercase words and print the alphabet distance between the paired letters at every position.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
String TransformationsApply each letter-to-two-letters rule to the first occurrence of its letter in every word, updating the word after each rule.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Error DetectionFor each 16-bit value and its transmitted check bit, decide whether the check bit matches the parity of 1-bits in the value.Easy2Bit manipulationImplementationNo attempts yet1s128 MBJudgeable
Vigenère CipherEncrypt each given plaintext with the Vigenère cipher, shifting every letter by the aligned repeated keyword letter modulo 26.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Stacked Floating MountainsGiven several sequences, decide for each whether every element from the third onward equals the sum of the two before it.Easy2ImplementationArray+1No 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
Checkerboard RowsFor each of B boards, read n pieces given as column-row pairs and print the largest number of pieces sharing the same row.Easy2ArrayHash map+1No attempts yet1s128 MBJudgeable
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.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Fill the Rowboats!Print the numbers 1 through N, inserting the word Go! after every sixth number and after the last one.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Microsoft LogoPrint the Microsoft logo exactly as shown, matching every character, space, and line break.Easy2ImplementationNo attempts yet1s128 MBJudgeable
Secret LocationEach of six lines encodes one number by its character count; print the first three as Latitude and the last three as Longitude in the given format.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Greatest Common DivisorRead n pairs of positive integers and print the greatest common divisor of each pair on its own line.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
Least Common MultipleFor each of n test cases, read two natural numbers a and b and print their least common multiple.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
J-BoxPrint an N by N grid whose border cells are '#' and interior cells are 'J', with a blank line between test cases.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Mars MathEvaluate a chain of at most three Mars operations (@, %, #) on a starting number and print the result to two decimals.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
Letter TrianglesFor each data set, print a triangle of N lines where line i repeats the ith letter in sequence, starting from a given letter and wrapping Z to A.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
DedupeFor each of several strings, collapse every run of consecutive identical letters into a single letter and print the result.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Football TeamRead names one per line and swap every i with e and every I with E in each name.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Garbled MessageRead lines of garbled text until EOF and replace every occurrence of the substring "iiing" with "th", preserving all other characters and line breaks.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
YodaFor each sentence, move its first two words to the end and print the result.Easy2StringImplementationNo 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
Total CountRead fighter names until a line with 0, print each name with its kill count in first-appearance order, then the grand total.Easy2Hash mapImplementation+2No attempts yet1s128 MBJudgeable
Target PracticePrint an n by n square border with an X drawn across the inner grid using asterisks.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Which WayFor each positive integer, convert it to binary and print left, straight, or right depending on whether it has more 0s, equal 0s and 1s, or more 1s.Easy2Bit manipulationImplementation+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
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.Easy2MathGreedy+1No attempts yet1s128 MBJudgeable
LeagueGiven every match result in a round-robin soccer league, compute each team's total points and print its rank, where tied teams share the best rank.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
Dice GameSimulate a piece on a board of cells, applying a die roll then the cell's instruction, and report how many rolls reach the goal.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
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.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
ContestGiven 20 scores, split into two groups of 10, output each group's sum of its top 3 scores.Easy2SortingImplementationNo attempts yet1s128 MBJudgeable
ChangeGiven a purchase amount below 1000 yen paid with a 1000-yen bill, find the minimum number of coins in the change.Easy2GreedyMath+1No attempts yet1s128 MBJudgeable
Caesar CipherGiven an uppercase word encrypted by shifting each letter forward three positions, shift every letter back by three to recover the original.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Card Flipping GameGiven two rows of n digit cards, reveal pairs left to right; the larger card wins both cards' sum, and equal cards each keep their own.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
Tunnel Entrance and ExitTrack the number of cars in a tunnel each minute from entrance and exit counts, and print the maximum count, or 0 if it ever goes negative.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
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.Easy2ImplementationMath+2No attempts yet1s128 MBJudgeable
BirthdayGiven each student's name and birthday, print the name of the youngest student, then the oldest.Easy2ImplementationSorting+1No attempts yet1s128 MBJudgeable
Comparison OperatorsRead C comparison expressions with integer operands, evaluate each, and print "Case N: true" or "Case N: false" until a line with operator E ends input.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
BakuganGiven each player's monster sequence over at most 10 rounds, add points per round and award a one-time 30-point bonus for the first three-in-a-row, then name the winner.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Hailstone SequencesFor each starting value H up to 500, simulate the Collatz rule and print the largest number that appears before reaching 1.Easy2SimulationImplementation+1No attempts yet1s128 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
PangramRead sentences until a line holding a single asterisk, and print Y if a sentence contains all 26 lowercase letters, otherwise N.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
Jingle ComposingSplit a slash-delimited composition into measures and count how many note durations sum exactly to 1.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
FeynmanFor each N, count all axis-aligned squares contained in an N by N grid of unit cells, ending at the sentinel 0.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Weekend LotteryGiven N past draws of C distinct numbers from 1 to K, print all numbers that appeared the fewest times, in increasing order.Easy2ArrayImplementationNo attempts yet3s128 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
Grade StatisticsFor each class, read the scores, then report the maximum, the minimum, and the largest gap between neighboring scores after sorting in descending order.Easy2SortingImplementation+1No attempts yet1s128 MBJudgeable
Roll-call in Woop Woop HighRead each class's answers and count pupils into four groups: correct first try, correct late, never correct, and absent.Easy2ImplementationString+1No attempts yet1s128 MBJudgeable
Breed ProximityGiven a line of N cows with breed ids, find the largest breed id whose two occurrences lie within K positions of each other, or -1 if none exist.Easy2ArrayHash map+1No attempts yet1s128 MBJudgeable
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.Easy2MathImplementation+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
String Function EncodingApply the given suffix-plus-string operation C times to each input string and print the results.Easy2StringSimulationNo 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
Papaya JungleBessie moves greedily through a grid, always stepping to the adjacent square with the most uneaten papayas, and we sum the fruit she eats until she reaches the bottom-right corner.Easy2SimulationArray+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
Hay ExpensesGiven N daily hay counts and Q ranges, output the sum of counts over each range from S to E inclusive.Easy2Prefix sumArrayNo attempts yet1s128 MBJudgeable
Time CardsFor each cow, pair her START and STOP entries and print the total time she spent at the milking machine as hours and minutes.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
StatisticsRead N integers, print their mean and median rounded to six decimal places.Easy2ArraySorting+2No attempts yet1s128 MBJudgeable
TV ReportsTrack daily Dollar prices against the previous day and the running all-time high, printing NTV drop headlines and BBTV record headlines in day order.Easy2ImplementationSimulation+2No 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
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.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
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".Easy2ImplementationMath+1No 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
Ballot EvaluationSum the given parties' vote percentages and check the sum against an integer n using the guess's comparison operator.Easy2Hash mapImplementation+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
Hard to Believe, but True!Read the numbers in each equation backwards, add them, and check whether the sum equals the backwards-read result.Easy2StringMath+1No attempts yet1s128 MBJudgeable
Next in LineGiven the ages of the youngest and middle of three children in an arithmetic sequence, print the oldest child's age.Easy2MathImplementationNo 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
Time on TaskGiven a time limit and chore durations, find the largest number of chores that can be completed in any order.Easy2GreedySortingNo 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
Icon ScalingRead scaling factor k and print the fixed 3x3 icon with every character expanded into a k-by-k block.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
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.Easy2ImplementationString+1No attempts yet2s512 MBJudgeable
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.Easy2SimulationMathNo 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
English or French?Count the letters t and T against s and S across N lines and print English if t wins, otherwise French.Easy2StringImplementationNo 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
Computer PurchaseGiven n computers with RAM, CPU speed, and disk values, sort by the score 2R + 3S + D and print the top two names, breaking ties by smaller name.Easy2SortingImplementationNo attempts yet2s512 MBJudgeable
ISBN 1-3-SumGiven the last three digits of an ISBN starting with 9780921418, compute the 1-3-sum and print it.Easy2MathImplementation+1No attempts yet1s128 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
Good TimesGiven the time in Ottawa as hour*100+minute, print the local time in seven Canadian cities using fixed offsets, wrapping across midnight.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Body Mass IndexRead a weight and a height, compute weight divided by height squared, and print the BMI category.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Do the ShuffleSimulate a fixed 5-song playlist through button presses that rotate left, rotate right, or swap the first two songs, then print the final order.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable