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,994 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
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
Target PracticePrint an n by n square border with an X drawn across the inner grid using asterisks.Easy2ImplementationSimulationNo 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
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
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
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
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
String Function EncodingApply the given suffix-plus-string operation C times to each input string and print the results.Easy2StringSimulationNo 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
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
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
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
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
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
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
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
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
The Cell SellGiven daytime, evening, and weekend minutes, compute the monthly cost under two phone plans and print the cheaper one.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
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.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
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.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Simple EncryptionRemove non-letters from a message and shift each letter within its column by the alphabet position of the keyword letter above it.Easy2StringSimulation+1No 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
0123456789Read one digit from 0 to 9 and print it as a seven-segment display drawn with asterisks, three per segment, with no trailing whitespace.Easy2ImplementationSimulation+1No 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
Dressing UpRead an odd height H and print a bow tie of H rows where each side widens as rows approach the middle.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
CalendarGiven the weekday of the 1st and the number of days, print a month calendar in a fixed weekly layout with right-aligned columns.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Shift LettersFor each test case, rotate the letters of a word right by n positions and print the result in a fixed sentence format.Easy2StringImplementation+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
NonogramGiven a grid of black and white squares, print the lengths of the consecutive black blocks in each row and then each column.Easy2ImplementationArray+2No attempts yet1s1024 MBJudgeable
The Worm TurnsSimulate a 20-cell worm on a 50x50 grid through a list of moves, stopping when it hits itself, leaves the board, or finishes.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
ExpressionGiven N, build a fully parenthesized NAND (Sheffer stroke) expression for the carry-out bit by iterating a fixed string concatenation rule.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Stacked BowlsGiven a string of parentheses, compute the total stack height where the first bowl adds 10 and each following bowl adds 5 if it matches the previous direction or 10 if it differs.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
BookingsRead a flight's booked-seat count, then apply booking and cancellation lines, ignoring any that would push the count outside 0 to 68, and print the final count.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
ExerciseFor each machine, multiply each exercise level's energy rate by its duration and sum the totals per person.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
PolynomialGiven a polynomial's coefficients and an integer x, print the last three digits of |W(x)|, padded with leading zeros.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
WarehouseTally up to a million signed per-product shipment records and print the remaining stock of each product in alphabetical order.Easy2ArraySimulationNo attempts yet1s512 MBJudgeable
Rock Paper ScissorsSimulate k rounds of rock-paper-scissors across N robots, removing round losers until one robot remains or all rounds end in a draw.Easy2SimulationNo attempts yet1s128 MBJudgeable
TurtleSimulate the turtle's moves from the origin and report the area of the axis-aligned bounding box of its path.Easy2SimulationNo attempts yet1s128 MBJudgeable
Heeju's Math ExamSum the terms from position A to B in the sequence where each integer k appears k times in a row.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Guess the SongGiven the title words and the lyrics in order, find the earliest lyric position where at least half of the distinct title words have appeared.Easy2SimulationHash mapNo attempts yet1s128 MBJudgeable
DisplayAdd K consecutive numbers starting from the B-th value of a length-N sequence that repeats forever.Easy2ArraySimulationNo attempts yet1s128 MBJudgeable
TrainPassengers board in order into the non-full car with the fewest same-initial riders, ties broken by load then car number, and the program prints each car count.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
DisplayFit the words of a space-separated text into the fewest rows of width w, breaking a row only when the next word does not fit.Easy2GreedySimulationNo 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
Pig LatinConvert each word to Pig Latin by moving leading consonants to the end and appending ay.Easy2StringSimulationNo attempts yet1s128 MBJudgeable
W**h y**r mouth out with s**pReplace the middle two letters of every four-letter run whose first and last letters match the given list, scanning each line left to right with no overlap.Easy2StringSimulationNo attempts yet1s128 MBJudgeable
Crossword Puzzle Clue NumberingScan the letter grid, number each square that starts an across or down word, and list every entry number with its letter count.Easy2SimulationMatrix+1No attempts yet1s128 MBJudgeable
Painting PartyPaint up to 100 filled or one-pixel-border rectangles in order on an N by N grid and print the final colors.Easy2SimulationMatrixNo attempts yet5s128 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
Sequence Folding GameRepeatedly fold the list by adding symmetric pairs until two numbers remain, then Alice wins when the first is larger.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Gholam's Simple GameStarting from the marked tile and direction, walk n steps bouncing off both ends and count visits to yellow tiles.Easy2SimulationArrayNo attempts yet1s128 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
BoxesBoxes fall straight down in each column of a grid, and the program sums how many cells all boxes move.Easy2SimulationMatrixNo attempts yet1s256 MBJudgeable
Perfect ShuffleInterleave the top and bottom halves of a card list to perform one perfect shuffle for each test case.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Text RollSimulate a ball that rolls right over non-space characters and drops down through spaces until it falls off the last line, then report its exit column.Easy2SimulationNo attempts yet1s128 MBJudgeable
I Love CroatiaTrack the 210 seconds of answers and pass the bomb left on each correct answer to find who holds it when it explodes.Easy2SimulationNo attempts yet1s128 MBJudgeable
Roman Catholic MassThe program seats the latecomer in the empty spot with the most occupied neighbors and counts every adjacent occupied pair once.Easy2Brute forceMatrix+1No attempts yet1s128 MBJudgeable
Arithmetic with MorseYou sum each Morse number from its symbol values and evaluate the expression with multiplication before addition.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Presidential ElectionEach voter ranks all candidates, and the program counts first-choice votes and then a top-two runoff to report the winner and the deciding round.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Show Me The OperatorsEvaluate each space-separated expression in two left-to-right sweeps and print the operators in execution order with the final value.Easy2SimulationImplementationNo 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
Cuckoo for HashingSimulate cuckoo hashing insertions into two mod-indexed tables with displacement and print the final table contents.Easy2SimulationHash map+1No attempts yet2s128 MBJudgeable
UndercutAdd up both players' scores across card rounds where the higher card scores unless the lower card is exactly one less.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
LampGuards patrol in roster order, each toggling the lamps in one arithmetic progression, and you report how many lamps stay on.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Cellular AutomataSimulate all 64 update rules for g generations on the n by n grid and print the smallest rule that turns the start state into the end state.Easy2Brute forceSimulationNo attempts yet2s1024 MBJudgeable
CarsSimulate n cars adjusting speed by 5 m/s every 5 seconds to keep gaps within 80 to 100 meters, and output -1 on collision or the front car distance.Easy2SimulationImplementationNo attempts yet2s1024 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
VoteEach judge votes for the most interesting game they can afford, and the game with the most votes wins.Easy2SimulationArrayNo attempts yet1s128 MBJudgeable
Party InvitationSimulate m rounds of removing every person at a multiple of ri from the ordered list and print the survivors in order.Easy2SimulationArrayNo attempts yet2s256 MBJudgeable
Magic SquaresCheck each test case square by comparing every row, column, and both diagonal sums and report whether it is magic.Easy2MatrixSimulationNo attempts yet1s256 MBJudgeable
Clean UpRecompute each of the nine batting averages after adding the new series and reorder the lineup around the new best average.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Milo of Croton and the CalfSimulate Milo lifting the calf as it gains a pound a day, with strength gains after 3 days and soreness lasting 2 days, and report the first failure day.Easy2SimulationNo attempts yet1s256 MBJudgeable
Train PassengersDecide if per-station counts of passengers leaving, boarding, and left waiting fit the train capacity and boarding rules.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Van Gogh's Work ScheduleSimulate a first-come queue of painting jobs and print arrivals, starts, and finishes for hours 0 to 23.Easy2SimulationQueueNo attempts yet1s64 MBJudgeable
MiscalculationGiven a digit expression with + and * and Bob's answer, report whether it matches the precedence evaluation, the left-to-right evaluation, both, or neither.Easy2SimulationNo attempts yet1s256 MBJudgeable
Turtle GraphicsSimulate a turtle that steps forward and turns on a 64 by 64 grid, then report its final cell and how many cells it visited more than once.Easy2SimulationArrayNo attempts yet1s256 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
Anniversary 1Starting from April 2, 2014 as day 1, add N-1 days with leap years and print the date as YYYY-MM-DD.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Anniversary 2Given a start date as day 1 and a number N, print the date N minus 1 days later following the given leap year rules.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
The Wet KeypadGiven a permuted phone keypad, encode a message of up to 100 letters into multi-tap presses with # separators.Easy2ImplementationSimulationNo attempts yet1s32 MBJudgeable
FilterThe program checks each Bloom filter against every queried user id and lists the files that may hold at least one of them.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Urdu orthography verificationCheck whether each encoded Urdu letter uses the detached, initial, medial or final shape required by its position and the two special vowels.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Paprika ID CardsSimulate one left-to-right pass of conditional card swaps, then count paprikas whose final card matches their goal.Easy2SimulationArrayNo attempts yet1s256 MBJudgeable
Weather ForecasterClouds drift east one cell per minute, and each cell reports how many minutes until a cloud first arrives, or -1 if none ever does.Easy2SimulationArrayNo attempts yet1s256 MBJudgeable
Wait TimeReconstruct message timestamps from the log and sum each friend reply wait time, reporting -1 for a friend with an unanswered message.Easy2SimulationHash mapNo attempts yet1s256 MBJudgeable
Reversing basketsApply M given interval reversals in order to baskets numbered 1 to N, then print the final order from the left.Easy2ArraySimulationNo attempts yet1s256 MBJudgeable
Rotating the basket orderPerform M given segment rotations on baskets numbered 1 to N and print the final left-to-right order.Easy2SimulationArrayNo 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
Inverse Move-to-Front TransformReconstruct the lowercase string from its move-to-front code by simulating the 26-letter list.Easy2SimulationArrayNo attempts yet2s256 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
Sieve of EratosthenesSimulate the sieve of Eratosthenes as described and print the K-th crossed-out number for each N and K pair.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable